4

I use the configs, below on gnuplot to plot a linechart:

set style data histogram
set ylabel "Number of Received Packets"
set format y '%.0s %c'  #This is also another question I refer to at p.s, below
set style data linespoints
colorfunc(x) = x == 1 ? "#3399FF" : x == 2 ? "#00FF00" : x == 3 ? "#FF3333" : x == 4 ? "#00FFFF" : x == 5 ? "#003300" : "#FF00FF" 
plot for [COL=2:6] 'Histogram' using COL:xticlabels(1) title columnheader lt rgb colorfunc(COL)

and the result is like this:

enter image description here

as you can see, the label of y-axis and the values on each axis are too small and can not be read easily. How can I change the size of them and make them bold(or resize them in final plot)?

p.s: I also use set format y '%.0s %c' to Show human-readable Y-axis. So far so good and I'd say that this command does its job almost well but I prefer to remove the million (M) character from each value and put it on the label instead, what should I do to remove it?

Sina Sh
  • 1,177
  • 3
  • 15
  • 24
  • 2
    For the label size, take a look here: [set font size of values numbers on the axis](http://stackoverflow.com/questions/15732856/set-font-size-of-values-numbers-on-the-axis) – Schorsch Jan 15 '16 at 19:35
  • 1
    For changing the tick label number format, take a look at this Q&A: [re-tic axis in gnuplot](http://stackoverflow.com/questions/12462970/re-tic-axis-in-gnuplot) – Schorsch Jan 15 '16 at 19:37
  • `set termoption font "Arial-Bold,20"` – vagoberto Jan 16 '16 at 00:13

1 Answers1

5

If you are using an enhanced terminal, you can use the postscript notation to do this.

For example

set ytics format "{/:Bold {/=14 %h}}"

will make your ytic labels bold and in 14pt font.

The million character is added by the %c format specifier. If you don't want it just change your format specification to %.0s.

Thus to set your ytics to, let's say 12 points, in bold and NOT have that millions marker, you can do

set ytics format "{/:Bold {/=12 %.0s}}"

The question linked in the comments provides another way to set the size, but you can't do the bold format that way. If you wish to approach it with that command, you can do

set ytics font ",12"
set ytics format "{/:Bold %.0s}"

The help info for enhanced mode (?enhanced) provides more information, and the documentation that comes with gnuplot (several pdfs in the windows version case) provides further documentation on ps commands.

More information on the format specifiers can be obtained from the help system by ?format specifiers.

Matthew
  • 7,440
  • 1
  • 24
  • 49