我(对我来说)x轴上的日期有一个奇怪的问题。
我在第一列中使用(imo)linux时间;
1385856000,1.69,0,10.33,0,1.69,10.33,-8.64,12.14,3.5
1385942400,0,0.94,3.33,8.51,0.94,11.84,-10.9,13.7,2.8
1386028800,0,0.51,4.96,8.65,0.51,13.61,-13.1,15.8,2.7
1386115200,0,0.01,3.42,6.49,0.01,9.91,-9.9,10.6,0.7
V
V
V
1388361600,0,0.63,4.21,7.65,0.63,11.86,-11.23,13.93,2.7
1388448000,0,0.18,4.47,8.29,0.18,12.76,-12.58,14.48,1.9
在这种情况下2013年12月31天。但该行从30(11月?)开始。 现在在de“30”上绘制一个矩形,但当然不是这样。
这是我的剧本;
maand = "Dec"
jaar = "2013"
file = maand.jaar.'.txt'
set output maand.jaar.".png"
set datafile separator ","
set linestyle 1 lt 1 lc rgb "black"
set linestyle 2 lt 1 lc rgb "red"
set bmargin 2.2 # witruimte onder grafiek
set label font "arial, 7" # grootte font tbv labels in het grafiek
set boxwidth 0.8 relative
set terminal pngcairo truecolor enhanced size 1200, 500 background rgb "#FFF5F5"
stats file using 0 nooutput ; dagen = STATS_records
stats file using 10 nooutput ; zon = value(int(STATS_sum*1000))
stats file using 9 nooutput ; gebruikt = value(int(STATS_sum*1000))
afgenomen = gebruikt-zon
set timefmt "%s" ; fmt = "%s"
stats file using (strptime(fmt, stringcolumn(1))) every ::1::1 nooutput
maand = strftime("%B", STATS_max) ; jaar = strftime("%Y", STATS_max) ; datum = maand." ".jaar
set title 'Energie stromen '.datum font "arial bold, 14"
set xdata time ; set timefmt "%s" ; set format x "%d" # dit is de opmaak zoals je hem gaat zien
set xtics 86400 font "arial,12" offset -1.35,0.5
set mxtics 1
set grid ls 1 lc rgb "#dddddd"
set ytics font "arial, 12" offset 0.5,0
set ylabel "V e r m o g e n in kW" offset 3,1 font "helvetica, 12"
unset key
set key below left samplen 2
set key maxrows 1 # aantal regels onder het grafiek (met Watt/uur erin)
set style fill solid 1 border 0.5 # was transparent solid 0.5 border 0.5
set style rectangle fc linestyle 1 fs solid 0.5 noborder
set object rectangle front fillcolor rgb "#FFF5F5"
set object 2 rect from graph -.48, graph -1.5 to graph -0.004, graph 0.02 fc rgb "#FFF5F5"
plot file u ($1-43200):10 w boxes lc rgb "#00ff00" title "Deze maand zon: ".(zon/1000)." kW",\
file u ($1-43200):10:(sprintf("%2.1f",$10)) w labels offset 0.0,0.4 font "arial, 10" notitle,\
file u ($1-43200):(-1*$9) w boxes lc rgb "#ff0000" title "&{2}Verbruik: ".(gebruikt/1000)." kW",\
file u ($1-43200):(-1*$9):(sprintf("%2.1f",$9)) w labels offset 0,-0.4 font "arial, 10" notitle
有一个人是个人吗?
答案 0 :(得分:1)
30来自11月和你移动xtic标签的方式。
我认为,将标签放在方框下方的最佳方法是,框之间的抽搐和网格线如下:
set autoscale xfix
)plot file u 1:...
而不是plot file u ($1-43200):...
)绘制方框...
set xtics 86400 font "arial,12" scale 0, 1
set mxtics 2
set grid mxtics ytics ls 1 lc rgb "#dddddd"
set autoscale xfix
...
plot file u 1:10 w boxes lc rgb "#00ff00"
...
通过这些修改,我得到了您的示例数据和版本4.6.3
BTW:您可以将三个stats
来电压缩为一个:
stats file using 9:10 nooutput
dagen = STATS_records
zon = int(STATS_sum_y*1000)
gebruikt = int(STATS_sum_x*1000)