Gnuplot 5.0中dashtype索引的确切含义?

编程入门 行业动态 更新时间:2024-10-15 22:23:31
本文介绍了Gnuplot 5.0中dashtype索引的确切含义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Gnuplot 5.0中遇到了一个问题,即dashtype索引,例如手册中的``set dashtype 1(2,5,2,15)''.

I got a problem in Gnuplot 5.0, the dashtype index, such as ``set dashtype 1 (2,5,2,15)` in the manual.

我的问题是:括号内的这些数字到底是什么意思?我试图改变它们以得到一种感觉,但是知道确切的含义将是很棒的.

My question is: what do these numbers in parenthesis exactly mean? I tried to change them to get a feeling, but it would be great to know the exact meaning.

我的实际问题是,不幸的是,仅使用dashtype N就可以使行看起来与以前的4.6版本完全不同.我只是想重现gnuplot 4.6中制作的图.

My actual problem is, that simply using dashtype N, gives lines which look very different from the previous 4.6 version, unfortunately. I just try to reproduce the plots which were made in gnuplot 4.6.

推荐答案

这些是数字对

<solid length>,<empty length>

这些长度是内部单位长度的因素.虚线图案的长度还取决于dashlength端子选项和线宽.

Those lengths are factors for an internal unit length. The dash pattern length further depends on the dashlength terminal option and the line width.

所以,有

plot x dt (2,4,2,6)

绘制一个破折号,一个两倍的空白空间,一个相同长度的破折号,以及一个三倍长的破折号.

plots a dash, an empty space twice as long, again a dash of same length and an empty space three times the dash length.

然后第一个破折号的实际长度是

The actual length of the first dash is then

linewidth * terminal_linewidth * solid_length * terminal_dashlength * dash_unit

第一个示例:

set terminal pngcairo size 600,50 dashlength 2 linewidth 1 set output 'dash1.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10

可能令人困惑的是,某些终端(例如qt或wxt)默认情况下使用圆角线末端(终端选项round),该末端应用于每个单个破折号,这会扭曲实际给定的破折号长度:

What might be confusing is, that some terminals like qt or wxt use rounded line ends by default (terminal option round), which are applied to every single dash, which distorts the actually given dash lengths:

set terminal pngcairo size 600,50 round dashlength 2 linewidth 1 set output 'dash2.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10

终端选项square在每个末端将每个破折号延伸一个线宽:

Terminal option square extends each dash by one line width at each end:

set terminal pngcairo size 600,50 square dashlength 2 linewidth 1 set output 'dash2.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10

在最后一个示例中,最后的破折号长度为(4,2,4,4).

In this last example, the final dash lengths are (4,2,4,4).

要默认也使用其他终端来获得第一个示例的行为(精确的短划线长度),请使用butt终端选项.

To get the behavior of the first example (exact dash length) also by default with other terminals, use the butt terminal option.

更多推荐

Gnuplot 5.0中dashtype索引的确切含义?

本文发布于:2023-11-28 16:15:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643087.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:确切   含义   索引   Gnuplot   dashtype

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!