Histograms

ctioga version 1.5 brought a way to make quite nice-looking histograms by means of the --hist option.

ctioga --xpdf --math --math-xrange -1:1 \
    --math-samples 30 --margin 0,0,0.02,0 \
    --hist y-axis '1 - x**2'

Note the use of --margin so that there is space above the histogram, but not below (doesn’t look that nice, actually). The level until which the steps are drawn can be tuned, and the histograms can be filled as well. The width of the steps can also be tuned, and histograms can be freely mixed with normal curves. See:

ctioga --xpdf -N --math --math-xrange -1.5:1.5 \
    --math-samples 30 --hist y-axis \
    --margin 0.02 \
    --fill top --fill-transparency 0.5 \
    --hist-width 0.8 '1 - x**2' \
    --hist no --fill no '1 - x**2'

Note that the argument to --fill is completely ignored for the histogram.

You can play around with the --hist-left and --hist-right options to get pretty elaborated histograms:

ctioga -t 'Fancy Histograms !' -N --xpdf --theme pastel \
    --hist y-axis --fill y-axis --fill-transparency 0.4 \
    --math --math-xrange -1:1 --math-samples 16 \
    --hist-left 0.02 --hist-right 0.48 'x**2' \
    --hist-left 0.52 --hist-right .98 'x**2 + 0.1*rand()'