在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 | 无 | + | × | * | □ | ■ | ○ | ● | △ | ▲ | ▽ | ▼ | ◇ | ◆ |
(3)线条宽度(linewidth)、点大小(pointsize)。两者都可以设置为整数或小数。
(4)图样(style):gnuplot 描绘数据数据图形是以读入档案中的坐标值后,以图样绘上。gnuplot可提供 9种图样,分别是:
ü lines : 将相邻的点以线条连接。如 plot sin(x) with lines。
ü points : 将每一点以一符号绘上。如 plot sin(x) with points
ü linespoints : 同时具有 lines 及 points 的功能。
ü impulses : 将每一点画一垂直线至 X 轴。如 plot sin(x) with impulses。
ü dots : 将每一点绘一细点。如 plot sin(x) with dots。
ü steps : 以垂直线及水平线各一条来连接两点,形成梯形。如连接 (x1,y1),(x2,y2)两点,以(x1,y1)到(x2,y1)和(x2,y1)到(x2,y2) 两线段连接。如 plot sin(x) with steps。
ü errorbars : 对每一点坐标值 (x,y),画一由 (x,ylow) 至 (x,yhigh) 的线段。并在线段两端做上 tic mark。如plot sin(x) with errorbars。
ü boxes : The boxes style draws a box centred about the given x coordinate from the yaxis to the given y coordinate.如plot sin(x) with boxes。
ü boxerrorbars : 组合 errorbars 与 boxes 两者功能。如 plot sin(x) with boxerrorbars。
(5) 图例(key)
若想改变显示的图例名称,可通过下述语句实现:
plot 'node1' title“node_1” #将图例显示的名称从“node1”改为“node_1”
也可以通过下述语句直接在画线条时显示:
plot 'node1' title“node_1”with lines