gnuplot png输出不绘制虚线 [英] gnuplot png output doesn't plot dashed/dotted lines

查看:175
本文介绍了gnuplot png输出不绘制虚线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用gnuplot v4.4绘制包含虚线和连续线的图形.代码是:

I'm trying to plot a figure that contains both dashed and continuous lines with gnuplot v4.4 . The code is:

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时,我只会得到连续的行. 知道出了什么问题吗?

Problem is , I can't plot it to png. When I change the set term instruction to: set term png enhanced I get only continuous lines. Any idea what went wrong?

推荐答案

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

It turns out that I can't seem to get dashed lines in the png terminal either (the one with the GD backend). However, if you have the cairo terminals, you can get a png with dashed lines (assuming you pick the appropriate linetypes).

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

顺便说一句,test非常适合询问特定终端的行为.

As an aside, test is fantastic for inquiring what the behavior of a particular terminal will be.

这篇关于gnuplot png输出不绘制虚线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆