【问题标题】:How to produce dashed lines in gnuplot 5 using TikZ terminal?如何使用 TikZ 终端在 gnuplot 5 中生成虚线?
【发布时间】:2015-02-11 03:20:50
【问题描述】:

我最近升级到 gnuplot 5 并且无法使用 TikZ 终端生成虚线。运行这些命令:

set term tikz
set output "test.tex"
test

在 gnuplot 4.6(第一张图片)中生成虚线类型,但在 gnuplot 5(第二张图片)中只生成实线类型。有没有办法在不降级的情况下解决这个问题?

我尝试为 dashlength 终端选项设置不同的值,但这没有帮助。

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    在 5.0 中,gnuplot 改变了处理虚线的方式。默认情况下,所有线型都是实心的,这就是test 命令向您显示的内容。

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

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

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

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

    示例脚本:

    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
    

    【讨论】:

    • 有什么理由,为什么一定要这样做(对我不起作用:()
    • @V-X 你到底是什么意思?它就像它一样工作;)您使用哪个终端?请注意,并非所有终端都支持虚线。
    猜你喜欢
    • 1970-01-01
    • 2012-07-22
    • 1970-01-01
    • 1970-01-01
    • 2022-12-18
    • 2012-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多