web-dev-qa-db-ja.com

gnuplotpng出力は破線/点線をプロットしません

Gnuplot v4.4を使用して、破線と実線の両方を含む図をプロットしようとしています。コードは次のとおりです。

set term postscript eps enhanced color
set style line 1 linetype 1 lw 2
set style line 2 linetype 1 lw 2 linecolor rgb 'green'
set style line 3 linetype 1 lw 2 linecolor rgb 'blue'
set style line 4 linetype 4 lw 2 linecolor rgb 'red'
set style line 5 linetype 3 lw 2 linecolor rgb 'blue'

set border lw 3
set xtics font ',18'
set ytics font ',18'
set output 'roc.ps'
set key right bottom
plot 'roc_fpdock_isc_test' u 1:2 w l ls 1 title "Full optimization, test set" ,x w l ls 2 title "Random", 'roc_fpdock_isc_training' u 1:2 w l ls 3 title "Full optimization, training set", 'roc_mini_pep_sc_training' u 1:2 w l ls 4 title "Minimization only, training set", 'roc_mini_pep_sc_test' u 1:2 w l ls 5 title "Minimization only, test set"

問題は、pngにプロットできないことです。 set term命令を次のように変更すると:set term png enhanced連続した行しか表示されません。何が悪かったのか分かりますか?

14
Protostome

pngターミナル(Gdバックエンドを備えたターミナル)でも破線が表示されないようです。ただし、cairo端末がある場合は、破線のpngを取得できます(適切な線種を選択した場合)。

set term pngcairo dashed
set output "foo.png"
test
!display foo.png
!rm foo.png

余談ですが、testは、特定の端末の動作がどうなるかを調べるのに最適です。

24
mgilson

Pngcairoにはdashtypeのdtオプションがあります。ここの凡例:

Legend

例えば

set style line 5 linetype 3 dt 5 lw 3 linecolor rgb 'green' 

ダッシュタイプ5を与える

1
sridharn