2012-07-24 97 views
2

enter image description here我在Mac OS X v10.6.8上使用gnuplot 4.4 patchlevel 4。我運行一個gnuplot的腳本,它的簡化版本是這樣的:(文件1,文件2,...等在終端指定運行腳本之前)gnuplot在aqua終端中的虛線

reset 
set term aqua enhanced font "Times-Roman, 18" 
set term aqua dashed 
plot file1 u 3:10 w lines lt 1 linecolor rgb "#FF0000",\ 
    file2 u 3:10 w lines lt 1 linecolor rgb "#00FF00",\ 
    file3 u 3:10 w lines lt 1 linecolor rgb "#0000FF",\ 
    file4 u 3:10 w lines lt 1 linecolor rgb "#FF00FF",\ 
    file5 u 3:10 w lines lt 1 linecolor rgb "#00FFFF",\ 
    file6 u 3:10 w lines lt 2 linecolor rgb "#FF0000",\ 
    file7 u 3:10 w lines lt 2 linecolor rgb "#00FF00",\ 
    file8 u 3:10 w lines lt 2 linecolor rgb "#0000FF",\ 
    file9 u 3:10 w lines lt 2 linecolor rgb "#FF00FF",\ 
    file10 u 3:10 w lines lt 2 linecolor rgb "#00FFFF" 

文件1-5是一個數據集另外文件6-10是另一個文件。我希望文件1到5用實線繪製,文件6到10用虛線繪製。有什麼方法可以在aqua終端上做到這一點?根據內置的幫助,「線條可以繪製爲實線或虛線」。我查看了多個常見問題解答和文檔,但共識似乎是難以或不可能做到?另外,有沒有人知道一般的aqua終端或gnuplot命令的全面文檔?

編輯:繪製文件6-10我一直在使用lw 6來區分它們和1-5,因爲我無法使虛線工作。上面的腳本是否符合我的要求?換句話說,腳本是在做我認爲正在做的事情嗎? (繪製1-5條實線和6-8條粗線?)我問,因爲試圖製作虛線,我用「lt 2」代替「lw 6」。然而這導致file5被用虛線繪製,這很奇怪。

編輯2:我附上我的終端測試圖形,似乎沒有提到虛線?

編輯3:已更新腳本以反映所做更改。

編輯4:圖形現在是定期水色增強字體「Times-Roman,18」虛線;測試

enter image description here

+0

爲了響應您的編輯,圖塊的線型可能會在gnuplot內部增加。如果你想file5被繪製成lt lt',那麼你應該把它放在那裏,否則gnuplot只是猜測。 – mgilson 2012-07-24 17:42:21

+0

@mgilson - (上面編輯)好吧,現在正確繪圖,但所有的線條仍然堅實。 – whatsherface 2012-07-24 17:47:04

+0

你做了'定期水上增強字體'Times-Roman,18「dashed'(注意末尾的'dashed')。 'show terminal'的輸出是什麼? – mgilson 2012-07-24 17:49:18

回答

0

這還不算壞的實際(至少對我來說在OS-X 10.5.8與gnuplot的4.2。我停止建設aquaterm在我的新的gnuplot版本,因爲我不喜歡這樣終端)在aqua終端,線型1是固體,線型2是虛線。

set term aqua enhanced font "Times-Roman, 18" dashed 
plot sin(x) w lines lt 1 lc rgb "blue", cos(x) w lines lt 2 lc rgb "purple" 

要查看您的gnuplot版本將用於特定終端的線型,您可以設置終端(輸出如果終端需要的話)後使用test命令。

一種你的代碼應該是什麼樣子的建議:

reset 
set term aqua enhanced font "Times-Roman, 18" dashed 
plot file1 u 3:10 w lines lt 1 linecolor rgb "#FF0000",\ 
    file2 u 3:10 w lines lt 1 linecolor rgb "#00FF00",\ 
    file3 u 3:10 w lines lt 1 linecolor rgb "#0000FF",\ 
    file4 u 3:10 w lines lt 1 linecolor rgb "#FF00FF",\ 
    file5 u 3:10 w lines lt 1 linecolor rgb "#00FFFF",\ 
    file6 u 3:10 w lines lt 2 linecolor rgb "#FF0000",\ 
    file7 u 3:10 w lines lt 2 linecolor rgb "#00FF00",\ 
    file8 u 3:10 w lines lt 2 linecolor rgb "#0000FF",\ 
    file9 u 3:10 w lines lt 2 linecolor rgb "#FF00FF",\ 
    file10 u 3:10 w lines lt 2 linecolor rgb "#00FFFF" 

編輯

我剛纔看了一個朋友的電腦上。對她來說(gnuplot 4.4.4,os-X 10.6?)linetype 8是第一個虛線類型(突出顯示test命令的用處)。

+0

謝謝!但是,我應該在哪裏放置「set term aqua dashed」行?我只是在其他「設定術語」行之後卡住了它。我得到的情節非常混亂,讓我覺得我的原始情節從一​​開始就是錯誤的。我將編輯上面的腳本以顯示更多細節。 – whatsherface 2012-07-24 17:33:01

+0

@whatsherface - 編輯。 – mgilson 2012-07-24 17:41:09

+0

@whatsherface - 我已經添加了我認爲應該適用於您的代碼的內容。 – mgilson 2012-07-24 17:44:06