2014-04-05 36 views
0

固體和虛線輪廓,我有一個gnuplot的腳本如下:包括gnuplot的

set pm3d 
unset surface 
set pm3d map 
set style line 1 lt 1 lc rgb "white" 
set style line 2 lt 1 lc rgb "white" 
set style line 3 lt 1 lc rgb "white" 
set style line 4 lt 1 lc rgb "red" 
set style line 5 lt 1 lc rgb "blue" 
set style line 6 lt 2 lc rgb "white" 
set style line 7 lt 2 lc rgb "white" 
set style line 8 lt 2 lc rgb "white" 
set style line 9 lt 2 lc rgb "white" 
set style increment userstyles 
set contour base 
set cntrparam levels 8 
set cntrparam levels discrete -8*0.0004946, -6*0.0004946, -4*0.0004946,  -2*0.0004946, -2*0.0004946, 4*0.0004946, 6*0.0004946, 8*0.0004946 
set nokey 
splot '/data/ltl21/Data/PDB/HDFNI/BlindSurvey/imageresults/spectrum/HDF1map:189.20135-62.20442' u 1:2:3 

這樣,我想有負值虛輪廓線,併爲正值堅實輪廓。我可以改變輪廓的顏色與上述罰款,但我希望他們都是白色的,但它似乎並沒有使用LT,它只是選擇自己的線條樣式,並使用它..

做任何人都知道如何爲單個輪廓指定線型?

乾杯

回答

0

同樣的問題剛剛出現在我身上。這裏是一個很好的解決方法,我發現在http://www.gnuplot.info/faq/faq.html

gnuplot> # An example. Place your definition in the following line: 
gnuplot> f(x,y) = y - x**2/tan(y) 
gnuplot> set contour base 
gnuplot> set cntrparam levels discrete 0.0 
gnuplot> unset surface 
gnuplot> set table ’curve.dat’ 
gnuplot> splot f(x,y) 
gnuplot> unset table 
gnuplot> plot ’curve.dat’ w l 

使用splot與標準選項。您可以在一個文件中保存多個輪廓。同一個文件中的每個輪廓都將以相同的樣式繪製。 你可以設置你的情節選項像往常一樣:線型,線型等。這就是我如何使用它:

gnuplot> set cntrparam levels discrete 0,1,2,3 
gnuplot> set style line 1 lt 2 lw 4 lc rgb "cyan" 
gnuplot> set table 'mycontours.dat' 
gnuplot> splot 'mydata.dat' matrix 
gnuplot> unset table 
gnuplot> plot 'mycontours.dat' ls 1 

它在epslatex返回4周虛線青色的輪廓。看起來你需要保存到不同的輪廓風格的文件(或手動編輯文件)。

0

的multiplot可以用來解決這個問題:

set pm3d 
unset surface 
set pm3d map 
set view map 
set key center rmargin 
set dgrid3d 15,31 
set hidden3d 
set contour base 
set nosurface 
set grid lw 1 lc rgb 'gray' 

f(x,y) = x*y 

set nokey 

set cntrparam levels discrete 2, 4, 6, 8 

set linetype 1 lc rgb '#0042ad' lw 1.3 
set linetype 2 lc rgb '#0060ad' lw 3.1 
set linetype 3 lc rgb '#007cad' lw 31 
set linetype 4 lc rgb '#0099ad' lw 0.31 

set cntrlabel start 25 interval -1 font 'arial, 1' 
set style textbox noborder 

set multiplot 

splot f(x,y) w l title '' 

unset pm3d 
set linetype 1 lc rgb '#00ada4' lw 2 dashtype 2 
# notice how changing 'lw' or 'dashtype' does not have any effect after first use: 
set linetype 2 lc rgb '#00ad88' lw 1 dashtype 1 
set linetype 3 lc rgb '#00ad6b' lw 3 dashtype 4 
set linetype 4 lc rgb '#eeeeee' lw 4 dashtype 3 
set cntrparam levels discrete -8, -6, -4, -2 
splot f(x,y) w l 

unset multiplot 

取消設置pm3d是至關重要的,否則將上繪製從第一splot命令行。