Elaborated plots

ctioga 1.6 provides new ways to make complex plots, with alternate sets of x or y data, grids or columns of data sharing the same x values.

Plots with two axes

It is possible to plot two different curves sharing one axis on the same plot, with either the --y2 or the --x2 option.

ctioga --xpdf --math 'x**2' \
    --y2 'cos(x)' -y 'New $y$' \
    --end 'x**2 + 20'

Note that the effect of --y2 stops when --end is encountered.

Grids

You can make grids of separated plots using the --grid option, specifying either the number of columns of the number of rows. You start a new element of the grid with the --next option.

ctioga --xpdf --math -t "A nice grid" \
    --grid row=2 \
    -l '$x^2$' 'x**2' \
    -l '$x^2 + 4$' 'x**2 + 4' -t 'Squares' --next \
    -l '$\cos x$' 'cos(x)' \
    -l '$\sin x$' 'sin(x)' -t 'Trigonometry' --next \
    -l '$x$' 'x' -l '$-x$' ' -x' -t 'Lines' --next \
    -l '$\frac{1}{1 + \exp \frac{x}2}$' \
    --line-style Line_Type_Dots \
    '1/(1 + exp(0.5*x))' -t 'Sigmoidal'


Note that you need to use ' -x' rather than simply -x so that ctioga does not interpret it as the -x option.

Columns

You can also make columns that share the same X axes, but may have different Y values, using the --col option:

ctioga --xpdf --math --no-ylabel --col \
    -y 'First $y$' 'x**2' --next  \
    'cos(x)' 'sin(x)' -y 'New $y$'

Note the use of --no-ylabel so that the left side of the plot doesn’t get a common label (try it).

Automatic --next

Starting from ctioga 1.6.2, you can omit the --next provided that you want to change element at every specification in the command-line, using the --auto-next option:

ctioga --xpdf --math -t "Automatic next, take 1" \
    --grid row=2 --auto-next -N \
    'sin(x + 0##3)' 'x**2 + (0##3)*10' \
    '1/(1##4 + x**2)' 'asinh(x * 1##4)'

You can even split between each expansion using the --auto-next-expanded option:

ctioga --xpdf --math --no-ylabel \
    -t 'Automatic next, take 2' --col \
    --auto-next-expanded 'sin(x+0##3)'