2015-05-29 102 views
3

關於等高線圖的另一個問題。我正在使用GNUPLOT 4.6:自定義輪廓線

G N U P L O T 
    Version 4.6 patchlevel 6 last modified September 2014 
    Build System: Linux x86_64 

我試圖繪製一張彩色地圖和一個等高線地圖。我的終端是

set terminal pngcairo enhanced size 1440,900 crop font "Palatino,27" 

,我想繪製該

set contour surface 
    set cntrparam level discrete 0.3,0.067 
    set style line 2 lt 1 lc rgb "black" lw 3 
    set style line 3 lt 3 lc rgb "black" lw 1 
    set style increment user 
    splot 'file1' binary w pm3d nocontour,\ 
      'file2' binary w l nosurface 

使輪廓設置繪製2個等值線,無論是黑色的,一條虛線,一個堅實的,一粗,一瘦。它繪製了兩條厚度相等的實心紅線。

我嘗試了很多在Google上找到的解決方案。

1)我用「set linetype ...」替換「set style line ...」並刪除「set style increment user」一行。線變成黑色,實心,等厚。我可以改變顏色。

2)我試圖添加「set termoption dashed」一行。沒有什麼,破滅從未見過。

我在哪裏錯了?

非常感謝。

+0

您必須使用「設置線型」,「設置termopt破滅」,並使用線型與期望衝着模板。 – Karl

+0

@KarlRatzsch但是這對繪製輪廓不起作用。 – Christoph

+0

@KarlRatzsch,這正是我嘗試和告訴子彈2)。這是行不通的。 – marco

回答

1

的確,目前您不能對任何輪廓使用任意線型或樣式。改變顏色工作,也設置一個短劃線類型(然後使用第一個輪廓樣式之一),但不能混合虛線和實線並改變線寬。

在這種情況下,你必須寫輪廓到一個文件,你在你的第一個問題:)

不同輪廓的水平可以在以後用index關鍵字來訪問一樣。但請注意,在第一個數據集,你將有完整的表面輪廓在index 1開始:

set termoption dashed 
set contour surface 
set cntrparam level discrete 0.3,0.067 
set style line 2 lt 1 lc rgb "black" lw 3 
set style line 3 lt 3 lc rgb "black" lw 1 

set table 'temp.dat' 
splot 'file2' binary 
unset table 
unset contour 

splot 'file1' binary w pm3d nocontour,\ 
     for [i=1:2] 'temp.dat' index i with lines ls (i+1) 
+1

如果您更改線型而不是樣式,則它可以正常工作。等高線的問題在於衝刺破裂,請參閱http://sourceforge.net/p/gnuplot/bugs/1612/ – Karl

+0

@KarlRatzsch您不能對不同的輪廓線使用不同的短劃線或線寬 – Christoph

+0

您說得對, 「termopt虛線」給出了虛線輪廓(gp46),但確實無法改變。如果沒有明確設置,線寬(也就是v50中的速度)取自線型1。 – Karl