【发布时间】:2013-08-12 12:06:33
【问题描述】:
我想绘制一些库存数据。
数据位于 csv 文件中,我已经得到了几乎准确的图,因此从文件中读取不是问题。
set terminal pdf
set output "gnuplot/".MATNUM."-2012.pdf"
set datafile separator ";"
stats 'Stock-2012.csv' every ::4::18 using MATNUM nooutput
set border 3
set tics nomirror
set xzeroaxis
set xrange[0:14]
set xtics 1,1,13
set xtics rotate 90
set ylabel MATUNIT
maxplot = sprintf("Amount max:\n%.2f ".MATUNIT, STATS_max)
plot 'Stock-2012.csv' every ::4::18 using ($0+1):MATNUM:xticlabels(2) with linespoints title "Amount", STATS_max with lines lc rgb 'blue' title maxplot
其中 MATNUM 和 MATUNIT 是命令行参数,表示材料编号(即数据文件中的列标题)和测量材料的单位。
我的数据文件中的 x 值是小数,但 gnuplot 似乎切断了小数位。例如 12,98(逗号用作小数点分隔符,因为它是德国的库存)导致数据点位于 y=12。
我不确定,但我认为这只发生在最大和最小 y 值上,因为 STATS_max 每次都是整数。
我可以怎样做才能让我的分数达到正确的 y 值?
【问题讨论】:
标签: gnuplot