在NS2的gnuplot绘图程序中对线型(linetype)、点型(pointtype)、线条宽度(linewidth)、点大小(pointsize)、图样(style)都有相应的设定值,具体设置如下:
(1)线型(linetype )。在此类型中主要设置线条的颜色,具体对应如下:
n | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
linetype | black | red | green | blue | pink | 浅蓝 | yellow |
(2)点型(pointtype)。此类型用于设置点得形状,可分为14中,具体对应如下:
n | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
pointtype | 无 | + | × | * | □ | ■ | ○ | ● | △ | ▲ | ▽ | ▼ | ◇ | ◆ |
(4)图样(style):gnuplot 描绘数据数据图形是以读入档案中的坐标值后,以图样绘上。gnuplot可提供9种图样,分别是:
ü
ü
ü
ü
ü
ü
ü
ü
ü
(5) 图例(key)
下为一个具体例子的应用程序:
gnuplot> set title “cbr_delay” font “Times-Roman,12” #该图的标头为cbr_delay,字体大小为12号
gnuplot> set xlabel “simulation time”
gnuplot> set ylabel “delay time”
gnuplot> xrange [0:10]
gnuplot> xtics 0,1,10
gnuplot> plot 'node1' with linespoints lt 0 lw 2 pt 1 ps 1.5
点的形状为“+”,点的大小为1.5
#下一语句实现的功能为在同一个gnuplot图上绘制node2,线为黑色,线宽为2,点的形状为“×”,点的大小为1.5
gnuplot> replot 'node2' with linespoints lt 0 lw 2 pt 2 ps 1.5
上面设置实现的功能为:绘出两个节点的线形图,该图的标头为cbr_delay,字体大小为12号,x轴和y轴的表示分别为simulation time和delay time。X轴的坐标范围为0到10,之间以1为间隔标示。两个节点都是以linespoints图样绘制,线条颜色均为黑色,节点1的点形状为“+”,节点2的点形状为“×”。
Replot命令使得可以在同一张图中添加更多的图。例如,输入plot sin(x)后,尝试输入replot cos(x)。依照语法,该命令等同于 plot sin(x), cos(x) 。Replot 就是获取先前的绘图字符串,添加必要的逗号,然后附加输入给它的其余部分。
Gnuplot使用技巧:线和点的种类(Line and Point Types)
Line and Point TypesA lot of the default types that gnuplot chooses are rather nice, but many times it necessary to distinguish and use specific point types and line types. I have generated a huge gnuplot list using the gnuplot test function and then some image manipulation. I always lack this information and couldn't find any reference for this on the internet.


不画右侧和上侧的边框



任意放置标签的位置

每种输出格式下,gnuplot的颜色数量不同。emf格式下,gnuplot有十五种颜色
lt 1 至 lt 15。lt 16也为红色,但线形变为虚线。

emf格式下的前30种点、线
