Gnuplot线型

Gnuplot线型

如何在gnuplot上绘制不同类型的线?我得画出不同的颜色。我的脚本加入了几个文件,我认为这就是为什么线条不是破折号的原因。四个中只有两个是破灭的。谢谢费利佩


#!/usr/bin/gnuplot


set grid

set title 'Estado dos arquivos no BTRIM com peers de comportamento condicionado'

set xlabel 'Tempo discreto'

set ylabel 'Quantidade de arquivos'

set style line 1 lc rgb '#0060ad' lt 1 lw 2 pi -1 ps 1.0

set style line 2 lc rgb '#dd181f' lt 9 lw 2 pi -1 ps 1.0

set style line 3 lc rgb '#29c524' lt 6 lw 2 pi -1 ps 1.0

set style line 4 lc rgb '#7D72F9' lt 7 lw 2 pi -1 ps 1.0

set style line 5 lc rgb '#000000' lt 8 lw 2 pi -1 ps 1.0


set termoption dashed

#set pointintervalbox 0

#set boxwidth 0.1

#set style fill solid


plot '<paste ../00/StatisticNormal.txt ../01/StatisticNormal.txt ../02/StatisticNormal.txt  ../03/StatisticNormal.txt ../04/StatisticNormal.txt ../05/StatisticNormal.txt ../06/StatisticNormal.txt ../07/StatisticNormal.txt ../08/StatisticNormal.txt ../09/StatisticNormal.txt' smooth unique with line ls 1 title 'Normais', \

'<paste ../00/StatisticVogue.txt ../01/StatisticVogue.txt ../02/StatisticVogue.txt ../03/StatisticVogue.txt ../04/StatisticVogue.txt ../05/StatisticVogue.txt ../06/StatisticVogue.txt ../07/StatisticVogue.txt ../08/StatisticVogue.txt ../09/StatisticVogue.txt' smooth unique with line ls 2 title 'na Moda', \

'<paste ../00/StatisticPopular.txt ../01/StatisticPopular.txt ../02/StatisticPopular.txt ../03/StatisticPopular.txt ../04/StatisticPopular.txt ../05/StatisticPopular.txt ../06/StatisticPopular.txt ../07/StatisticPopular.txt ../08/StatisticPopular.txt ../09/StatisticPopular.txt' smooth unique with line ls 3 title 'Populares', \

'<paste ../00/StatisticRarity.txt ../01/StatisticRarity.txt ../02/StatisticRarity.txt ../03/StatisticRarity.txt ../04/StatisticRarity.txt ../05/StatisticRarity.txt ../06/StatisticRarity.txt ../07/StatisticRarity.txt ../08/StatisticRarity.txt ../09/StatisticRarity.txt' smooth unique with line ls 4 title 'Raros'


pause -1


慕哥9229398
浏览 534回答 1
1回答

GCT1015

直到4.6版a的破折号类型linestyle由the给出,linetype除了你明确地设置另一个之外,它也会选择线颜色linecolor。但是,对虚线的支持取决于所选的终端:有些终端不支持虚线,如png(用途libgd)其他终端pngcairo支持虚线,但默认情况下禁用。要启用它,请使用set termoption dashed或set terminal pngcairo dashed ...。终端之间的确切划线图案不同。要查看已定义的内容linetype,请使用以下test命令:运行set&nbsp;terminal&nbsp;pngcairo&nbsp;dashedset&nbsp;output&nbsp;'test.png'testset&nbsp;output得到:然而,postscript终端显示不同的破折号模式:set&nbsp;terminal&nbsp;postscript&nbsp;eps&nbsp;color&nbsp;colortextset&nbsp;output&nbsp;'test.eps'testset&nbsp;output5.0版从5.0版开始,引入了与线型,虚线图案和线条颜色相关的以下更改:dashtype引入了一个新参数:要获得预定义的破折号模式,请使用egplot&nbsp;x&nbsp;dashtype&nbsp;2您还可以指定自定义短划线模式plot&nbsp;x&nbsp;dashtype&nbsp;(3,5,10,5),\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2*x&nbsp;dashtype&nbsp;'.-_'终端选择dashed和solid被忽略。默认情况下,所有行都是实线。要将它们更改为虚线,请使用例如set&nbsp;for&nbsp;[i=1:8]&nbsp;linetype&nbsp;i&nbsp;dashtype&nbsp;i默认的线条颜色集已更改。您可以选择三种不同的颜色集set colorsequence default|podo|classic:
打开App,查看更多内容
随时随地看视频慕课网APP