Legends

Legends can be specified with the -l option before the curve.

ctioga --xpdf --math -l '$x^2$' 'x**2' \
    --no-legend '1 - x**2' \
    -l 'Big sine' '30 * cos(x)'

Legends are given automatically to the plots (a bit like in gnuplot). While this is definitely useful is some cases, you might want to turn it off at some points, using the -N option:

ctioga --xpdf --math 'x**2' \
    -N '1 - x**2' '30 * cos(x)' \
    -l 'Legend' '10*x'

Using -N doesn’t prevent you from giving a legend yourself with -l, it merely prevents ctioga from giving a default one.

The position of the legend can be chosen easily: either one of of the sides:

ctioga --xpdf --math -l '$x^2$' 'x**2' \
    -l '$1 - x^2$' '1 - x**2' \
    --legend-pos bottom,0.2

Note that currently, whichever the position of the legend, legend elements will always grow downwards, and not sideways. That will be for later versions of ctioga !

You can also position legends inside the plot, in the same way as insets:

ctioga --xpdf --math --math-xrange -1:1 \
    -l '$x^2$' 'x**2' \
    -l '$1 - x^2$' '1 - x**2' \
    --legend-inside .5,.5:.3

The --legend-scale option gives finer control on the size of the legend (keep in mind that the default value for --legend-scale is around 0.65, so setting to 1 enlarges it !):

ctioga --xpdf --math --math-xrange -1:1 \
    -l '$x^2$' 'x**2' \
    -l '$1 - x^2$' '1 - x**2' \
    --legend-inside .5,.5:.3 --legend-scale 1