2013-04-23 70 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

相關問題