如何使用TikZ终端在gnuplot 5中产生虚线? [英] How to produce dashed lines in gnuplot 5 using TikZ terminal?

查看:292
本文介绍了如何使用TikZ终端在gnuplot 5中产生虚线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级到gnuplot 5,无法使用TikZ终端生成虚线.运行以下命令:

I have recently upgraded to gnuplot 5 and have been unable to produce dashed lines using the TikZ terminal. Running these commands:

set term tikz
set output "test.tex"
test

在gnuplot 4.6(第一个图像)中生成虚线类型,但在gnuplot 5(第二个图像)中仅生成实线类型.有没有一种方法可以解决此问题而不降级?

produce dashed line types in gnuplot 4.6 (first image), but only solid ones in gnuplot 5 (second image). Is there a way to fix this without downgrading?

我尝试为dashlength终端选项设置不同的值,但这无济于事.

I have tried setting different values for the dashlength terminal option, but that didn't help.

推荐答案

使用5.0 gnuplot已更改了处理虚线的方式.默认情况下,所有线型均为实线,这是test命令向您显示的内容.

With 5.0 gnuplot has changed its way to deal with dashed lines. All line types are solid by default, this is what the test command shows you.

要启用虚线,请使用新的dashtype关键字,例如

To enable dashed lines, use the new dashtype keyword, e.g

plot for [i=1:4] i*x dashtype i

适用于所有支持虚线的终端.

That works for all terminals which support dashed lines.

请注意,使用dashtype,您还可以指定自己的破折号模式.

Note, that with dashtype you can also specify your own dash patterns.

示例脚本:

set terminal lua tikz linewidth 3 standalone
set output 'dash.tex'    
unset key

set linetype 1 dashtype 2
set linetype 2 dashtype '..-'
set linetype 3 dashtype (2,2,4,4,6,6)
plot for [i=1:3] i*x

这篇关于如何使用TikZ终端在gnuplot 5中产生虚线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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