1
votes

This is My data :

18_AGT_s 8234.00 8234.00 8234.00
18_MAC_s 8414.36 8308.36 8246.33
9_MAC_r 8414.36 8308.36 8246.33
9_MAC_s 8414.55 8309.55 8246.45
8_MAC_r 8414.55 8309.55 8246.45
8_MAC_s 8414.56 8310.08 8246.47
6_MAC_r 8414.56 8310.08 8246.47
6_MAC_s 8416.19 8310.21 8246.49
1_MAC_r 8416.19 8310.21 8246.49

and here is my gnuplot code :

plot "dat" using ($0+1):2 with linespoints pt 8 ps 2 lt 2 lw 4 lc rgb "green" title "DMSR","dat" using ($0+1):3 with linespoints pt 5 ps 2 lt 3 lw 4 lc rgb "blue" title "Alarm","dat" using ($0+1):4 with linespoints pt 6 ps 2 lt 4 lw 4 lc rgb "red" title "Emergency"

and here is my out put :

enter image description here

But In the step part I want to have 18_AGT_s and 18_MAC_s and 9_MAC_s and .... for example on the X part I want to have 18_AGT_s in stand of 1 or I want to have 18_MAC_2 instand of 2 and 9_MAC_r instand of 3 etc. Any help thanks

1

1 Answers

3
votes

Use the xticlabels() option with the column number with the labels as argument (1, in this case):

# Optionally rotate labels so they fit
set xtics rotate

plot "dat" using ($0+1):2 with linespoints pt 8 ps 2 lt 2 lw 4 lc rgb \
"green" title "DMSR","dat" using ($0+1):3 with linespoints pt 5 ps 2 \
lt 3 lw 4 lc rgb "blue" title "Alarm","dat" using \
($0+1):4:xticlabels(1) with linespoints pt 6 ps 2 lt 4 lw 4 lc rgb \
"red" title "Emergency"

enter image description here

Here you only need to use it for the last plot instance so that it overwrites the number options.