2013-04-23 44 views

回答

1

如果你有一个文件你的数据,假设data.dat

X1 Y1 Y2 Y3 
1 0.1 0.2 0.3 
... ... ... ... 

你可以画出Y1,Y2和Y3与X与

plot 'data.dat' using 1:2, '' u 1:3, '' u 1:4 

u是为using的快捷方式。

+0

@ Pascail..Thanks ......这是工作。但在图中,顶部显示使用1:2的'data.dat'。我该如何删除它? – curious 2013-04-23 10:19:57

+1

使用'title'选项,'plot'data.dat'使用1:2标题“我是一个很棒的情节”。 – Pascail 2013-04-23 11:54:12

+0

你可以在网上找到很多有用的例子(http://www.gnuplotting.org/是一个很好的资源,用户手册附带很​​棒的图表) – Pascail 2013-04-23 11:57:19

1

如果所有的y值都是相同的单位,那么一个y轴就足够了。如果不是,可以将x与最多2个y轴对齐(here's how)。

1

您可以使用“坐标轴”选项进行绘图。下面是一个例子使用相同的X值绘制2个图:

set xrange [-4:4] 
plot cos(x) axes x1y1 title "cos" with linespoints lt 1 pt 7 ps 0.0,\ 
    sin(x) axes x1y2 title "sin" with linespoints lt 2 pt 8 ps 0.0 
pause mouse any "Click the mouse or hit any key to terminate" 

如果运行与gnuplot的它看起来应该像下面的图片example double plot

相关问题