Style examples
This page will show you how to use effectively styles and the
likes. ctioga automatically changes style for every new curve, as
can be seen in
ctioga --xpdf --math 'x**2' '1 - x**2' '30 * cos(x)'
We can easily add markers and change the linestyle:
ctioga --xpdf --math --math-samples 50 \
--marker auto --line-style Line_Type_Dots \
'x**2' '1 - x**2' '30 * cos(x)'
Note that we need to lower the number of points in the curves with
--math-samples so that markers don’t overlap.
Lines can be taken out completely using --line-style no. Along with
choosing a smaller marker size, we can get a ‘dot cloud’ effect:
ctioga --xpdf --math --line-style no --marker auto \
--marker-scale 0.2 'x**2' '1 - x**2' '30 * cos(x)'
Using themes and sets
There are two different (though connected) ways to change completely the styles used in a graph. You can first use sets:
ctioga --xpdf --math --color-set colorblind \
'x**2' '1 - x**2' '30 * cos(x)'
The list of available sets is given in ctioga --help. You can also
use themes which can extend well beyond the style of the curves:
ctioga --xpdf --math --theme pastel \
'x**2' '1 - x**2' '30 * cos(x)'
Note that in the latter case, the background color is slightly different.
Special sets
Gradients are special sets beginning with the gradient: keyword,
followed by the colors and the number of steps. In the following
example, we go smoothly from Red to Green in 30 steps.
ctioga --xpdf --math -N -t 'Gradients' \
--color-set 'gradient:Red--Green,30' \
'sin(x) + 0.1 * 1##30'
From ctioga version 1.8, it is possible to specify a single color,
marker or line style as a set, or a list of elements separated by |:
ctioga --xpdf --math -N -t 'Special sets' \
--color-set 'Red|Blue' --line-style-set Dashes \
'sin(x) + 0.1 * 1##20'
Note the quotes around the | signs, to avoid the shell to interpret
them as the beginning of a pipe.
Style manipulations
It is sometimes useful to have curves sharing the same style, or at
least some bits of it. You can achieve this either by using
--same-style (for the last style used) or a combination of
--save-style and --use-style (tip: look at the legend):
ctioga --xpdf --color-set colorblind \
--math 'cos(x) + 0##2' \
--save-style biniou 'sin(x) + 0##1' \
--same-style 'sin(x) - 1' \
--use-style biniou 'sin(x) - 2'
Style brought this way can be overridden. If you want a curve to have the same color and markers as another one, but with a different line style, it is fairly easy to do:
ctioga --xpdf --math --math-samples 30 \
--marker auto 'x**2' --save-style a \
'1 - x**2' '30 * cos(x)' \
--use-style a --line-style Line_Type_Dots \
'x**2 + 10'
Style overrides
Style in ctioga is based on two different mechanisms: themes
provide a basic style that is overridden by command-line options, such
as --color, or --marker. The latter are called overrides, and
starting from version 1.6.1, ctioga provides some small commands to
manipulate them:
ctioga -N -t 'Override manipulations' --math \
--marker auto --marker-scale 0.2 --line-style no 'x**2' \
--save-override cloud --reset-override \
'1 - x**2' '10 - x**2' --use-override cloud 'x**2 - 10'
This example creates a first curve with small markers and no line,
saves that override under the name cloud, and uses it afterwards on
the last curve.