7

Sorry for the (probably) basic question but I'm just getting started with gnuplot. What I'd like is to create an axis label with a portion of it in italics. Something like:

xlabel: Not italics, italics

I understand it's easy to set a label to display italics (set xlabel font "Times-Italic", 20), but is it possible to have only a portion of the label in italics?

Memento Mori
  • 3,327
  • 2
  • 22
  • 29
  • 3
    Unfortunately, that depends on the terminal. For `set terminal postscript eps enhanced` you can use `set xlabel "not italics, {/Times-Italic italics}"`. But other terminals like `pdfcairo` at the moment don't support font styles for the enhanced text mode, see also [bold enhanced text in gnuplot](http://stackoverflow.com/questions/16428338/bold-enhanced-text-in-gnuplot). This was already reported as bug: http://sourceforge.net/p/gnuplot/bugs/1240/. – Christoph Nov 18 '13 at 10:48
  • Thanks for this answer! It turns out I was encountering almost exactly the same situation as outlined in the bug report. I can use postscript eps enhanced and convert afterwords. This helped a lot, thanks! – Memento Mori Nov 18 '13 at 20:11

1 Answers1

8

Usually you can use the enhanced text mode to change the font for parts of a string:

set termoption enhanced
set xlabel "not italics, {/Times-Italic italics}"

Unfortunately, that behaviour is not supported by all terminals, see bold enhanced text in gnuplot and the related bug report #1240.

It works e.g. with the postscript and png terminals, but does not work with pngcairo and pdfcairo.

Community
  • 1
  • 1
Christoph
  • 47,569
  • 8
  • 87
  • 187