analysisCairo.h
1 /*
2  @copyright Russell Standish 2000-2013
3  @author Russell Standish
4  This file is part of EcoLab
5 
6  Open source licensed under the MIT license. See LICENSE for details.
7 */
8 
9 #ifndef ANALYSIS_CAIRO_H
10 #define ANALYSIS_CAIRO_H
11 #include "plot.h"
12 
13 namespace ecolab
14 {
15  struct HistoGram: public Plot, public HistoStats
16  {
17  HistoGram() {plotType=bar;}
18  // overload add_data to plot the data
19  void add_data(TCL_args args) {
21  reread();
22  }
23  void reread() {
24  Plot::clear();
25  if (size() && max>min) Plot::add(1,bins(), histogram());
26  }
27  void clear() {
28  Plot::clear();
29  HistoStats::clear();
30  }
31  void outputdat(TCL_args args);
32  };
33 }
34 
35 #include "analysisCairo.cd"
36 #endif
Definition: plot.h:35
Histogramming tool.
Definition: analysis.h:80
void add_data(TCL_args args)
TCL access - append an array of data.
Definition: analysis.h:65
Definition: analysisCairo.h:15
float min
max and min value
Definition: analysis.h:38
array_ns::array< double > bins()
void add(unsigned pen, double x, double y)
add a datapoint
Definition: plot.h:149
array_ns::array< double > histogram()
return histogram
Represent arguments to TCL commands.
Definition: TCL_obj_base.h:138
size_t size() const
number of elements
Definition: arrays.h:1766
_OPENMP
Definition: accessor.h:16
void clear()
clear all datapoints (and redraw)