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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 11:46:44  来源:igfitidea点击:

gnuplot linewidth and line type with terminal postscript

bashgnuplot

提问by ziulfer

In gnuplot I've using set term postscript enhanced eps coloras well as lw 5and lt 1, 2 and 3, for three different graphs.

在gnuplot的我一直在使用set term postscript enhanced eps color以及lw 5lt 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 lwto 2stuffs start getting better, but I'd like to keep using the lw 5and at the same time be able to use the different line types. Am I missing something?

如果我降低lwto的值2开始变得更好,但我想继续使用lw 5并且同时能够使用不同的线类型。我错过了什么吗?

EDIT

编辑

Follow two graphs. Using set term postscript enhanced eps color dashed,

跟随两张图。使用set term postscript enhanced eps color dashed,

enter image description here

在此处输入图片说明

and set term epscairo color dashed:

set term epscairo color dashed

enter image description here

在此处输入图片说明

In both cases I've used lw 4.

在这两种情况下,我都使用了lw 4.

The version with epscairolooks better, but still the dashed-dot-dot-dashed, looks awful, close to f(x)=1for sin(2x)

与版本epscairo比较好看,但还是虚线-点-点划线,看起来很恐怖,接近f(x)=1sin(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 movetooperation. 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 epscairoterminal and see if this works better.

正如你所看到的,中间的破折号比其他的要长得多。尝试使用epscairo终端,看看这是否效果更好。

enter image description here

在此处输入图片说明

回答by Miguel

When you set the terminal you can specify the dash length with the dloption, 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

enter image description here

在此处输入图片说明

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

enter image description here

在此处输入图片说明