首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gnuplot png输出不会绘制虚线/虚线

gnuplot png输出不会绘制虚线/虚线
EN

Stack Overflow用户
提问于 2012-09-26 20:04:34
回答 2查看 25.5K关注 0票数 16

我正在尝试使用gnuplotv4.4绘制一个既包含虚线又包含连续线的图形。代码是:

代码语言:javascript
复制
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时,我只得到连续的行。知道哪里出问题了吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-09-26 20:17:29

事实证明,在png终端(带有GD后端的那个终端)中,我似乎也看不到虚线。但是,如果您有cairo终端,您可以得到一个带有虚线的png (假设您选择了适当的线型)。

代码语言:javascript
复制
set term pngcairo dashed
set output "foo.png"
test
!display foo.png
!rm foo.png

顺便说一句,test非常适合用来查询特定终端的行为。

票数 26
EN

Stack Overflow用户

发布于 2017-08-09 19:14:37

在pngcairo中有dashtype的dt选项。图例如下:

e.g

代码语言:javascript
复制
set style line 5 linetype 3 dt 5 lw 3 linecolor rgb 'green' 

指定dashtype为5

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12601348

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档