gnuplot输出曲线图

1.准备数据文件
timedata.txt文件内容如下:
2019-09-10    100
2019-09-11    900
2019-09-12    1300
2019-09-13    300
2019-09-14    1000

2.启动gnuplot,输入如下命令
set xdata time                   ##X轴代表时间
set timefmt "%Y-%m-%d" ##数据文件中的时间格式
set format x "%m/%d"      ##X轴显示的时间格式
set title "test"                   ##标题
plot 'D:\gnuplot_data\timedata.txt' using 1:2 with linespoints

输入如下:

gnuplot输出曲线图_第1张图片

 

gnuplot支持的时间格式

gnuplot输出曲线图_第2张图片

你可能感兴趣的:(gnuplot输出曲线图)