gnuplot dash line-gnuplot黑白图画虚线

 需要画黑白图,但是又有几条线在一张图上,就需要有区分度。点的效果又不太好,糊成一片。可以用dash line,查了一些链接,最终也没成功。为什么呢。写的很清楚:

In gnuplot version 5 the dash pattern (dashtype) is a seperate property associated with each line, analogous to linecolor or linewidth.

 那就升级版本吧。

$ tar xzf gnuplot-5.0.1.tar.gz
$ cd gnuplot-5.0.1
$ ./configure
$ make
$ sudo make install

画图脚本,black_plot.sh

#! /bin/sh
instance=1
file1=1_bw.txt
file2=2_bw.txt
file3=3_bw.txt
output=bw_pic
gnuplot<<!
set xlabel "time/s" 
set ylabel "rate/kbps"
set xrange [0:300]
set yrange [0:3000]
set terminal png monochrome dashed
set output "${output}_bw.png"
plot "${file1}" u 1:2 title "flow1"  with lines  lw 2,\
"${file2}" u 1:2 title "flow2" with lines  lw 2,\
"${file3}" u 1:2 title "flow3" with lines dashtype '..-' lw 2
set output
exit
!

 效果:
在这里插入图片描述

[1] https://stackoverflow.com/questions/29526044/installing-gnuplot-5-0-on-ubuntu
[2] gnuplot dash lines http://gnuplot.sourceforge.net/demo/dashtypes.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值