GNUPLOT

- not so Frequently Asked Questions -

update 2004/12/13

About Label (No.3)

1 | 2 | 3

Can I use a colored label ?

[ver.4] ONLY !

Gnuplot 3.8 allows you to change colors of label, title, and axis names. The color is specified by linetype (lt) .

gnuplot> set style line 1 lt 1
gnuplot> set style line 2 lt 3
gnuplot> set style line 3 lt 4
gnuplot> set style line 4 lt 5
gnuplot> set ylabel "Y-axis" textcolor lt 1
gnuplot> set xlabel "X-axis" textcolor lt 2
gnuplot> set title "Sample" textcolor lt 3
gnuplot> set label "Label" at 2,0.5 textcolor lt 4
gnuplot> plot exp(-x)
fig/sample4.6
up

How can I change the direction of Y-axis name ?

Orientation (direction) of Y axis name depends on the terminal you are using, namely, if the terminal can rotate strings then gnuplot does it. For example, even you see your Y-axis name which is shown horizontally, the axis name becomes vertical when the figure is drawn in a Postscript file. Gnuplot ver.4 can rotate the Y axis name on the computer screen. The direction of Y axis name is determined automatically, and there is no option to control this.

If you want to change the direction of Y axis, use set label , not set ylabel . For example, if you want to draw the Y axis name horizontally on the left side of Y axis, try this.

gnuplot> set lmargin 20
gnuplot> set label 1 'Y-AXIS' at graph -0.2, graph 0.5

The position of text is specified by using graph coordinate, move -20% in the X direction, and Y location is at the mid-point of graph frame.

up