linux – gnuplot行类型不希望被更改

linux – gnuplot行类型不希望被更改,第1张

概述你能帮我吗?我希望将一行类型更改为点线.我使用这些命令: gnuplot> set terminal png size 750,210 nocrop butt font "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf" 8gnuplot> set output "/root/data.png"gnuplo 你能帮我吗?我希望将一行类型更改为点线.我使用这些命令:
gnuplot> set terminal png size 750,210 nocrop butt Font "/usr/share/Fonts/truetype/ttf-liberation/liberationSans-Regular.ttf" 8gnuplot> set output "/root/data.png"gnuplot> set xdata timegnuplot> set timefmt "%Y-%m-%d"gnuplot> set format x "%b %d"gnuplot> set ylabel "item1"gnuplot> set y2label "item2"gnuplot> set y2ticsgnuplot> set datafile separator "|"gnuplot> plot "/root/results.txt" using 1:2 Title "item1" w lines lt 4,"/root/results.txt" using 1:3 Title "item2" with lines

但我总是得到洋红色线.
我使用的是4.6版补丁级别0.
谢谢你的回复.

解决方法 有几种方法可以使用set命令更改线条颜色:

>定义线条样式:

set style line 1 linetype 1 linecolor 7set style line 2 linetype 1 linecolor rgb "#dd7700"plot x linestyle 1,x**2 linestyle 2

您必须明确指定使用哪种线条样式.
>如果未指定任何内容,则选择并增加线型而不是线型:

set style line 1 linetype 1 linecolor 7set style line 2 linetype 1 linecolor rgb "#dd7700"set style increment userplot x,x**2

>重新定义默认行类型(在4.6.0版中引入):

set linetype 1 linecolor 7set linetype 2 linetype 1 linecolor rgb "magenta"plot x,x**2

请注意,与线型不同,set linetype的重新定义是持久的;他们不受重置的影响.要重置它们,您必须使用set linetype 1 default.

因此,最小的绘图脚本可能如下所示:

resetset terminal pngcairo dashed monoChromeset output "/root/data.png"set xdata timeset timefmt "%Y-%m-%d"set format x "%b %d"set datafile separator "|"set style data linesplot "/root/results.txt" using 1:2 linetype 1,"" using 1:3 linetype 3
总结

以上是内存溢出为你收集整理的linux – gnuplot行类型不希望被更改全部内容,希望文章能够帮你解决linux – gnuplot行类型不希望被更改所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1049985.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存