ConicBundle
Private Attributes | List of all members
CH_Tools::BoxPlot Class Reference

for generating LaTeX figures with successive box plots and corresponding tables More...

#include <BoxPlot.hxx>

Public Member Functions

Constructors
 BoxPlot ()
 
 ~BoxPlot ()
 
methods
void set_use_samplesz (bool us)
 if set to true (==default), the samples size is used for the width of the box polots
 
void set_use_logscale (bool ls)
 if set to true (default is false), the values are plotted with log scale
 
void set_use_minmax (bool mm)
 if set to true (==default), min and max are plotted as outliers irrespective of whether they are outliers or not, but no outliers are plotted
 
int standalone_preamble (std::ostream &out)
 to generate LaTeX source that results in a seperate pdf-file of the plot use this to output the corresponding LaTeX preamble
 
int standalone_postamble (std::ostream &out)
 if things were started with standalone_preamble() finish the document with calling this
 
int start_plot (std::ostream &out, const char *options=0)
 output the LaTeX commands for starting a new plot More...
 
int end_plot (std::ostream &out)
 when, after start_plot() all plots have been added by add_plot(), this ouputs the closing part of the plot
 
int next_data (const CH_Matrix_Classes::Matrix &datavector)
 input the next data group to be used in add_plot or add_tabularline; from this data the routine computes min, lwhisker, lquartile, median, uquartile, uwhisker, max, samplesz
 
int add_plot (std::ostream &out, CH_Matrix_Classes::Real pos, const char *color=0, const char *name=0, CH_Matrix_Classes::Real val=0.)
 output the box plot to the data of the last call to next_data(); multiple calls without intermediate calls to next_data() all output the same data More...
 
int add_tabularline (std::ostream &out, int prec=6)
 output minval & lquartile & median & uquartile & maxval as computed by the latest previous next_data() call. The number of significant digits is given in precision.
 

Private Attributes

CH_Matrix_Classes::Real median
 as set in the last call to next_data()
 
CH_Matrix_Classes::Real lquartile
 as set in the last call to next_data()
 
CH_Matrix_Classes::Real uquartile
 as set in the last call to next_data()
 
CH_Matrix_Classes::Real lwhisker
 as set in the last call to next_data()
 
CH_Matrix_Classes::Real uwhisker
 as set in the last call to next_data()
 
CH_Matrix_Classes::Real minval
 as set in the last call to next_data()
 
CH_Matrix_Classes::Real maxval
 as set in the last call to next_data()
 
CH_Matrix_Classes::Matrix outliers
 as set in the last call to next_data()
 
CH_Matrix_Classes::Integer samplesz
 as set in the last call to next_data()
 
bool use_samplesz
 if true [=default], the box plot width depends on the relative sample size
 
bool use_logscale
 if true [default:false], the values of the box plot are output in log scale
 
bool use_minmax
 if true [=default], min and max are plotted as outliers irrespective of whether they are outliers or not, but no outliers are plotted
 

Detailed Description

for generating LaTeX figures with successive box plots and corresponding tables

Each call to next_data() with a vector of dimension samplesz computes the values minval,lwhisker, lquartile, median, uquartile, uwhisker, maxval and collects the vector outliers.

For creating the full LaTeX source for a pdf-file of a single plot that displays the statistics of several vectors use, in this sequence

There is limited support for adding some options. Once the data has been set in next_data, it can be used for several add_plot() calls to different out streams and some of the data can be output to a table by add_tabularline().

Member Function Documentation

◆ add_plot()

int CH_Tools::BoxPlot::add_plot ( std::ostream &  out,
CH_Matrix_Classes::Real  pos,
const char *  color = 0,
const char *  name = 0,
CH_Matrix_Classes::Real  val = 0. 
)

output the box plot to the data of the last call to next_data(); multiple calls without intermediate calls to next_data() all output the same data

Parameters
outoutstream (the file)
posthe "draw position" of pgfplots
colorthe color to be used for this box
namethe name of the data to this box, printed in rotated form
valthe name will be printed downwards starting from this value

Referenced by set_use_minmax().

◆ start_plot()

int CH_Tools::BoxPlot::start_plot ( std::ostream &  out,
const char *  options = 0 
)

output the LaTeX commands for starting a new plot

Parameters
outoutstream (the file)
optionsas

Referenced by set_use_minmax().


The documentation for this class was generated from the following file: