Gnuplotting

Create scientific plots using gnuplot

May 20th, 2011 | 1 Comment

The tikz and epslatex terminal directly write text in the graph by using LaTeX. But if you want a line break within a label, a simple \\ will not work. In order to get a line break we can apply the \shortstack command.

set label '\shortstack{first line\\second line}'

In the following example, a principal component analysis (PCA) for attribute ratings of a listening test has been computed and the attributes together with the presented stimuli are plotted in the graph. The natural + little comb filter attribute and its counterpart included a line break (click on the figure for a larger version).

loudspeaker circle

Fig. 1 A PCA plot with a line break in two of its attribute labels (click on the figure for a larger view, code to produce this figure)

1 Comment

  1. Jon says:

    Thanks so much – this was exactly what I was looking for and couldn’t seem to find elsewhere.

    Much appreciated.

Leave a Reply