2

I would like to be able to control the font size for the labels produced by

plot file u 1:2:(sprintf("%4.3f", $1)) with labels offset char 0,2 t ""

but have not found a way yet. Let me add that I use the epslatex terminal.

painfulenglish
  • 161
  • 1
  • 7
  • 1
    From `help labels`: `plot 'cities.dat' using 5:4:1 with labels font "Times,8"` – user8153 Sep 21 '18 at 18:31
  • Does not seem to have any effect. Note that I use the epslatex terminal. – painfulenglish Sep 21 '18 at 20:29
  • In the case of the latex terminals the font choice and size are under the control of LaTeX rather than gnuplot's internal enhanced text processing. You would have to format the label as a TeX command. – Ethan Sep 21 '18 at 22:38
  • 2
    `plot file u 1:2:(sprintf('{\\tiny %4.3f}', $1)) with labels notitle` – Ethan Sep 21 '18 at 23:11
  • Note that the format uses single quotes so only two backslashes are needed. If for some reason you need to place it in double quotes an extra layer of escape processing is needed, thus four backslashes – Ethan Sep 21 '18 at 23:14
  • @EthanMerritt wonderful. If you post it as an answer, I'll accept it. – painfulenglish Sep 22 '18 at 04:52

1 Answers1

4

In the case of the latex terminals the font choice and size are under the control of LaTeX rather than gnuplot's internal enhanced text processing. You would have to format the label as a TeX command.

plot file u 1:2:(sprintf('{\\tiny %4.3f}', $1)) with labels notitle    

Note that the number of escaped backslashes depends on whether you place the format in single or double quotes.

Ethan
  • 13,715
  • 2
  • 12
  • 21