Insets

It is fairly easy to make insets in ctioga:

ctioga --xpdf --math --xrange 0:1 --yrange 0:1 \
    --interpolate 'x**2' '1 - x**2' \
    --inset .3,.5:.3x.4 --rescale 0.7 \
    'cos(x)' 'sin(x)' --end \
    'x**5'

Note that the settings of --xrange of the outer plot don’t apply to the inset. It has completely independant set of axis. --interpolate was used to smooth out the curves in the outer plot because the number of points in the range 0:1 is very small (10) with the default settings of the --math backend. Note the --rescale option so the text, lines, etc. look smaller in the inset.

The --zoom-inset option does the same as --inset, except that the curves in the current plot are added to the inset (without their legend). Very useful to make zooms, in combination with --xrange and --yrange:

ctioga --xpdf --math --interpolate \
    -t "Inset with a zoom" \
    --legend-inside 0.5,0.7:0.25 \
    -l '$x^2$' 'x**2' \
    -l '$1 - x^2$' '1 - x**2' \
    --zoom-inset .5,.23:.3 \
    -t "Nice zoom" --rescale .7 \
    --xrange -1:1 --yrange 0:1 \
    -l '$\cos \sqrt{2} \, x$' 'cos(sqrt(2)*x)'

Position specification

ctioga version 1.8 provides three different ways to specify the position of the inset (and also of subplots).

Traditional way

As above, you specify the center of the inset and its width and optionally its height (taken equal to its width if absent).

ctioga --xpdf -N --math  --xaxis line --yaxis line \
    --inset .5,.4:.6x.4 'cos(x)' 'sin(x)'

Note: to make it easier to visualize the actual position of the inset, we turned axes of the main plot into plain lines.

Specifying the corners

You can specify the exact position of two corners of the plot using the following syntax:

ctioga --xpdf -N --math  --xaxis line --yaxis line \
    --inset '0.2,0.2;0.6,0.9' 'cos(x)' 'sin(x)'

X-geometry-like position

You can also use a X-geometry-like specification, that is you provide ctioga with the size of the box and the position of one of its corners (in this example, the right top):

ctioga --xpdf -N --math  --xaxis line --yaxis line \
    --inset 0.8x0.5-0.9+0.9 'cos(x)' 'sin(x)'