2017-03-05 49 views
2

我有兩個數據集x,y,x1,y1。我想用一個數字來繪製它們。如何繪製兩行火炬gnuplot?

require 'gnuplot' 

local x,y,x1,y1 = unpack(data) 
gnuplot.xlabel('PPL') 
gnuplot.ylabel('Epoch #') 
gnuplot.plot({x,y},{x1,y1}) 

enter image description here

這工作好,但我希望有直線,而不是虛線。另外,我想在右上角添加一個圖例。 唉,無論我嘗試過什麼樣的組合,都行不通。

gnuplot.plot({x,y},{x1,y1},'-') 
gnuplot.plot('1','2',{x,y},{x1,y1},'-') 
gnuplot.plot({'1','2',{x,y},{x1,y1},'-'}) 

我如何可以繪製兩條線和一個數字與gnuplot的添加一個傳奇?

回答

0

根據the docs下面應該工作:

gnuplot.plot({'first', x, y, '-'}, 
    {'second', x1, y1, '-'}) 
+0

不幸的是沒有,沒有。我試過這種表示法。 – minerals

0

torchstyle變量包含:「設置樣式數據linespoints」,該設置將數據繪製到linespoints風格。

你需要編寫此命令:

gnuplot.raw('set style data lines')