为什么线宽0的宽度不为零

为什么线宽0的宽度不为零

本文介绍了gnuplot:为什么线宽0的宽度不为零?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

lw 0的线宽不为零(即不可见)的原因是什么?

What is the reason that lw 0 doesn't have zero linewidth, i.e. invisible?

我在gnuplot手册中找到了什么

What I find in the gnuplot manual:

好吧,如果lw 0是一个乘数,那么所得的线宽应该为零,而与终端的默认线宽无关.

Ok, if lw 0 is a multiplier then the resulting linewidth should be zero independent of the terminal's default linewidth.

询问的原因是最终有可能使用with linespoints并以编程方式在with lineswith points之间的循环内切换.

The reason for asking is to eventually have the possibility to use with linespoints and programmatically switch within a loop between with lines and with points.

代码:

### linewidth 0 isn't zero
reset session

set key out
set yrange[-0.9:10.9]
set ytics 1

plot for [i=0:10] i with lines lw i title sprintf("linewidth %g",i)

### end of code

结果:

顺便说一下,y轴上的伪像是什么?在ytics 3,4,6,7,9,10(wxt-terminal)?

By the way, what are the artefacts at the y-axis e.g. at ytics 3,4,6,7,9,10 (wxt-terminal)?

推荐答案

Mike Nakis是正确的,对于至少某些gnuplot输出终端(包括PostScript),gnuplot要求宽度为0的行以及有问题的语言或库进行解释表示为"1像素"或最细的线".

Mike Nakis is correct that for at least some of the gnuplot output terminals, including PostScript, gnuplot asks for a 0 width line and the language or library in question interprets that as "1 pixel" or "thinnest possible line".

同样,"pointtype 0"并没有真正丢失,它会产生一个像素点.

Similarly "pointtype 0" is not truly missing, it produces a single pixel dot.

但是,您可以通过使用线型"nodraw"来完全禁用线条画.这给出了一对互补的命令

You can, however, disable the line drawing altogether by using linetype "nodraw".That gives a complementary pair of commands

plot sin(x) with linespoints lt nodraw pt 7         # only the points are visible
plot sin(x) with linespoints lt 1 pt 0              # only the lines are visible

在某些情况下,可能会知道lt nodraw的等效数字是lt -2.

In some circumstances it may help to know that the numeric equivalent for lt nodraw is lt -2.

这篇关于gnuplot:为什么线宽0的宽度不为零?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 12:23