gnuplot png输出不';t绘制虚线/虚线

gnuplot png输出不';t绘制虚线/虚线,gnuplot,Gnuplot,我试图用gnuplotv4.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

我试图用gnuplotv4.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
终端(带有GD后端的终端)中获得虚线。但是,如果您有cairo端子,则可以获得带有虚线的png(假设您选择了适当的线型)


另一方面,
test
对于查询特定终端的行为非常有用。

您在pngcairo中有dashtype的dt选项。此处的图例:

e、 g


提供dashtype 5

如果您有
pngcairo
,我建议您使用它。根据我的经验,它比
png
(带有GD后端的那一个)的绘图更好看。谢谢!在使用png术语遇到相同的奇怪问题后,它节省了一些时间。
set term pngcairo dashed
set output "foo.png"
test
!display foo.png
!rm foo.png
set style line 5 linetype 3 dt 5 lw 3 linecolor rgb 'green'