2014-10-01 37 views
1

我有一個數據文件(points.dat):是否可以在圖表上分配不同樣式的Gnuplot線,以及圖例中的相應條目?

0.00 0.0 
0.10 0.1 
0.15 0.2 
0.40 0.3 
0.60 0.4 
0.50 0.5 
0.60 0.6 
0.40 0.7 
0.15 0.8 
0.10 0.9 
0.00 1.0 

我運行一個gnuplot的任務(平滑X(Y)與tmp文件數據):

#!/usr/bin/env gnuplot 

set terminal png size 600,400 
set output "data.png" 

set table '.tmp' 
plot 'points.dat' using 2:1 smooth csplines 
unset table 

plot '.tmp' using 2:1 with lines, 'points.dat' with points pt 7 

我有兩個傳說(鍵)項:

enter image description here

但我想合併兩個:

enter image description here

我可以畫一個虛擬的linespoints以外的視圖窗口,但應該是正確的方法。


@克里斯托夫的評論

這不是「純數學」,有技術文檔中的一些標準設計圖。閱讀報告的人應該能夠將統治者附加到圖表並查看參數的近似值。

現在我的choise 「notitle」 這兩個情節和虛擬符合標題:

plot 'tmp' using 2:1 with lines lt 6 notitle, \ 
    'points.dat' with points lt 6 notitle, \ 
    1E999 lt 6 with linespoints title "My Cool Title" 

enter image description here

(很抱歉,如果說混亂的這一切谷歌翻譯。)​​)

+0

我不知道你是怎麼做到的。除此之外,我還認爲,由於這兩部分(插值線和點)具有不同的起源和不同的含義,所以它沒有什麼意義:可能是一些計算或測量的結果,另一部分僅僅是視覺增強(?) – Christoph 2014-10-02 07:23:28

+0

已添加到問題中。還有一件事:爲什麼X(Y)圖形與Y(X)有區別? Y(X)可以有沒有薩滿教的正常傳說。 – knkd 2014-10-02 15:07:27

+0

我不太清楚,如果我把你對了:如果你繪製X(Y)或Y(X)根本就不重要。這只是因爲你需要插值而發揮作用。那麼你實際上有兩個數據集(原始數據和插值),你不能用一個圖例條目進行繪圖。所以這個'虛擬'情節就是要走的路。順便說一句:你也可以添加這個作爲你自己的答案並接受它。 – Christoph 2014-10-02 19:37:16

回答

1

現在我的選擇標題爲「notitle」的情節和虛擬行:

plot 'tmp' using 2:1 with lines lt 6 notitle, \ 
    'points.dat' with points lt 6 notitle, \ 
    1E999 lt 6 with linespoints title "My Cool Title" 

enter image description here

相關問題