bash 带有终端附言的 gnuplot 线宽和线型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26908763/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
gnuplot linewidth and line type with terminal postscript
提问by ziulfer
In gnuplot I've using set term postscript enhanced eps color
as well as lw 5
and lt 1, 2 and 3
, for three different graphs.
在gnuplot的我一直在使用set term postscript enhanced eps color
以及lw 5
和lt 1, 2 and 3
,三个不同的图形。
Due to the width of the graphs the line types don't look so different for the three cases.
由于图形的宽度,三种情况下的线型看起来并没有太大不同。
If I decrease the value of lw
to 2
stuffs start getting better, but I'd like to keep using the lw 5
and at the same time be able to use the different line types. Am I missing something?
如果我降低lw
to的值2
开始变得更好,但我想继续使用lw 5
并且同时能够使用不同的线类型。我错过了什么吗?
EDIT
编辑
Follow two graphs. Using set term postscript enhanced eps color dashed
,
跟随两张图。使用set term postscript enhanced eps color dashed
,
and set term epscairo color dashed
:
和 set term epscairo color dashed
:
In both cases I've used lw 4
.
在这两种情况下,我都使用了lw 4
.
The version with epscairo
looks better, but still the dashed-dot-dot-dashed, looks awful, close to f(x)=1
for sin(2x)
与版本epscairo
比较好看,但还是虚线-点-点划线,看起来很恐怖,接近f(x)=1
了sin(2x)
回答by Christoph
I think this is a general problem of dashed lines with the postscript terminal: For some internal reasons, the points aren't drawn as one continuous line, but every 100 points the line is interrupted by a moveto
operation. This can lead to very strange results for dashed lines.
我认为这是 postscript 终端的虚线的普遍问题:由于某些内部原因,这些点没有绘制为一条连续的线,而是每 100 点该线被一次moveto
操作中断。对于虚线,这可能会导致非常奇怪的结果。
A pathological example is
一个病理例子是
set terminal postscript eps mono dashed dl 10 lw 5
set samples 200
set output 'test.eps'
plot x lt 2
As you can see, the center dash is much longer than the others. Try using the epscairo
terminal and see if this works better.
正如你所看到的,中间的破折号比其他的要长得多。尝试使用epscairo
终端,看看这是否效果更好。
回答by Miguel
When you set the terminal you can specify the dash length with the dl
option, this will also increase the separation between dashes:
当您设置终端时,您可以使用该dl
选项指定破折号长度,这也会增加破折号之间的间隔:
set term postscript enhanced eps color dl 4
plot sin(x) lw 5 lt 2, cos(x) lw 5 lt 3
You can also add points to better distinguish your graph:
您还可以添加点以更好地区分您的图表:
set term postscript enhanced eps color
plot "+" u ():(sin()) w lp lw 5 lt 2 ps 2 pt 7