ConicBundle
BoxPlot.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CH_TOOLS__BOXPLOT_HXX
4 #define CH_TOOLS__BOXPLOT_HXX
5 
14 #include <iostream>
15 #include <iomanip>
16 #include "matrix.hxx"
17 
18 namespace CH_Tools {
19 
25 
45 class BoxPlot
46 {
47 private:
57 
58  bool use_samplesz;
59  bool use_logscale;
60 
61  bool use_minmax;
62 
63  public:
67  BoxPlot();
68 
69  ~BoxPlot();
71 
75 
77  void set_use_samplesz(bool us){use_samplesz=us;}
79  void set_use_logscale(bool ls){use_logscale=ls;}
81  void set_use_minmax(bool mm){use_minmax=mm;}
82 
84  int standalone_preamble(std::ostream& out);
86  int standalone_postamble(std::ostream& out);
87 
89  int start_plot(std::ostream& out,
90  const char* options=0
91  );
93  int end_plot(std::ostream& out);
94 
96  int next_data(const CH_Matrix_Classes::Matrix& datavector);
97 
99  int add_plot(std::ostream& out,
101  const char* color=0,
102  const char* name=0,
104  );
105 
107  int add_tabularline(std::ostream& out,int prec=6);
108 
110 
111 };
112 
114 
115 }
116 
117 #endif
118 
void set_use_logscale(bool ls)
if set to true (default is false), the values are plotted with log scale
Definition: BoxPlot.hxx:79
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
Some convenient inline tools like a clock for timing, a random number generator, a heapsort template ...
Definition: clock.hxx:29
CH_Matrix_Classes::Real maxval
as set in the last call to next_data()
Definition: BoxPlot.hxx:54
bool use_minmax
if true [=default], min and max are plotted as outliers irrespective of whether they are outliers or ...
Definition: BoxPlot.hxx:61
CH_Matrix_Classes::Real lwhisker
as set in the last call to next_data()
Definition: BoxPlot.hxx:51
Header declaring the classes CH_Matrix_Classes::Realrange and CH_Matrix_Classes::Matrix having Real e...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
CH_Matrix_Classes::Real uwhisker
as set in the last call to next_data()
Definition: BoxPlot.hxx:52
for generating LaTeX figures with successive box plots and corresponding tables
Definition: BoxPlot.hxx:45
CH_Matrix_Classes::Real minval
as set in the last call to next_data()
Definition: BoxPlot.hxx:53
int start_plot(std::ostream &out, const char *options=0)
output the LaTeX commands for starting a new plot
int standalone_postamble(std::ostream &out)
if things were started with standalone_preamble() finish the document with calling this ...
CH_Matrix_Classes::Integer samplesz
as set in the last call to next_data()
Definition: BoxPlot.hxx:56
bool use_logscale
if true [default:false], the values of the box plot are output in log scale
Definition: BoxPlot.hxx:59
int add_tabularline(std::ostream &out, int prec=6)
output minval & lquartile & median & uquartile & maxval as computed by the latest previous next_data(...
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 ...
CH_Matrix_Classes::Real median
as set in the last call to next_data()
Definition: BoxPlot.hxx:48
void set_use_minmax(bool mm)
if set to true (==default), min and max are plotted as outliers irrespective of whether they are outl...
Definition: BoxPlot.hxx:81
CH_Matrix_Classes::Real lquartile
as set in the last call to next_data()
Definition: BoxPlot.hxx:49
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 compu...
Matrix class for real values of type Real
Definition: matrix.hxx:74
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...
bool use_samplesz
if true [=default], the box plot width depends on the relative sample size
Definition: BoxPlot.hxx:58
CH_Matrix_Classes::Matrix outliers
as set in the last call to next_data()
Definition: BoxPlot.hxx:55
CH_Matrix_Classes::Real uquartile
as set in the last call to next_data()
Definition: BoxPlot.hxx:50
void set_use_samplesz(bool us)
if set to true (==default), the samples size is used for the width of the box polots ...
Definition: BoxPlot.hxx:77
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 corre...