来自x(日期)的Gnuplot y轴值 [英] Gnuplot y-axis value from x(dates)

查看:118
本文介绍了来自x(日期)的Gnuplot y轴值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道你可以从x(x店的日期)中获取价值
i有以下日期

  13/3/2014 218.11.11 
12/4/2014 218.37.12
5/5/2014 218.31.34
7/5/2015 218.31.10
23/5/2014 218.32.21
4/6/2014 218.41.14

我们有这些日期,这些ips我想要储存ips在月
示例:
5/2014 - 3 IPS



在gnuplot图表我想打印每个ips每个月有多少
这里是我现在有的

 设置xlabel 'date'
set title'Gnuplot test graph'
set ylabel'IPS'
set terminal png size 1400,500
set datafile sep'''

set xdata time
set timefmt'%Y-%m-%d%H:%M:%S'
set xrange [2009/3/27 00:00:2014 / 4/11 22:28]

set xtics nomirror rotate by -45
set grid
set term png
set output'file.png'

plot'data.dat'使用1:2与点


解决方案

为了计数数量相等的x值,可以使用 plot ...平滑频率使用固定数量的 1 y值:

  set xdata time 
set timefmt'%d /%m /%Y'
plot'data.dat'使用1:(1)平滑频率

这是绘制条目数每天



要按月份对值进行分组,您必须将本月的所有值标准化为本月初的一个月。为此,您可以使用 tm_mday 函数,该函数将根据时间戳记获取当前月份的日期:

  set yrange [0:*] 
set xdata time
set timefmt'%d /%m /%Y'
set xrange ['01 / 03/2014':'01/06/2014']
set xtics 30 * 24 * 60 * 60
设置格式x'%b%Y'
plot'data.dat'使用(timecolumn(1) - (tm_mday(timecolumn(1)) - 1)* 24 * 60 * 60):( 1)平滑频率w lp pt 7 ps 2 notitle
/ pre>


I would like to know how the y can take value from the x (the x store the dates) i have the following dates

13/3/2014   218.11.11
12/4/2014   218.37.12
5/5/2014    218.31.34
7/5/2015    218.31.10
23/5/2014   218.32.21
4/6/2014    218.41.14

we have these dates and these ips i want store the ips in months example: 5/2014 - 3 IPS

in gnuplot the graph i want to print every how much ips has every month here is what i have until now

set xlabel 'Date'
set title 'Gnuplot test graph'
set ylabel 'IPS'
set terminal png size 1400,500
set datafile sep ','

set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set xrange ["2009/3/27 00:00":"2014/4/11 22:28"]

set xtics nomirror rotate by -45
set grid
set term png
set output 'file.png'

plot 'data.dat'using 1:2 with points 

解决方案

In order to count the number of equal x-values, you can use plot ... smooth frequency using a fixed number of 1 for the y-values:

set xdata time
set timefmt '%d/%m/%Y'
plot 'data.dat' using 1:(1) smooth frequency

This plots the number of entries for each day.

To group the values by month, you must normalize all values for a month to the first of this month. For this you can use the tm_mday function, which gets you the day of the current month, based on a timestamp:

set yrange [0:*]
set xdata time
set timefmt '%d/%m/%Y'
set xrange['01/03/2014':'01/06/2014']
set xtics 30*24*60*60
set format x '%b %Y'
plot 'data.dat' using (timecolumn(1) - (tm_mday(timecolumn(1))-1)*24*60*60):(1) smooth frequency w lp pt 7 ps 2 notitle

这篇关于来自x(日期)的Gnuplot y轴值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆