Gtkmm-PLplot 3.0
A scientific plotting library for Gtkmm
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Gtk::PLplot::PlotDataHistogram Class Referenceabstract

abstract base class that will hold a single dataset that can be rendered as a histogram More...

#include <gtkmm-plplot/plotdatahistogram.h>

Inheritance diagram for Gtk::PLplot::PlotDataHistogram:
Inheritance graph
[legend]

Public Member Functions

virtual ~PlotDataHistogram ()
 
double get_data_minimum ()
 
double get_data_maximum ()
 
int get_nbins ()
 
void set_expand_bins (bool expand_bins)
 
bool get_expand_bins ()
 
void set_empty_bins (bool empty_bins)
 
bool get_empty_bins ()
 
virtual void get_extremes (double &xmin, double &xmax, double &ymin, double &ymax)=0
 
- Public Member Functions inherited from Gtk::PLplot::PlotDataLine
virtual ~PlotDataLine ()
 
void set_color (Gdk::RGBA color)
 
Gdk::RGBA get_color ()
 
void set_line_style (LineStyle line_style)
 
LineStyle get_line_style ()
 
void set_line_width (double line_width)
 
double get_line_width ()
 
- Public Member Functions inherited from Gtk::PLplot::PlotData
virtual ~PlotData ()
 
void set_name (Glib::ustring name)
 
Glib::ustring get_name ()
 
void show ()
 
void hide ()
 
bool is_showing () const
 
sigc::signal< void(void)> signal_changed ()
 
sigc::signal< void(void)> signal_data_modified ()
 
virtual void draw_plot_data (const Cairo::RefPtr< Cairo::Context > &cr, plstream *pls)
 
- Public Member Functions inherited from Gtk::PLplot::Object
virtual void set_manage ()
 

Protected Member Functions

 PlotDataHistogram (double datmin, double datmax, int nbins, bool expand_bins=true, bool empty_bins=true)
 
- Protected Member Functions inherited from Gtk::PLplot::PlotDataLine
 PlotDataLine (Gdk::RGBA color, LineStyle line_style, double line_width)
 
- Protected Member Functions inherited from Gtk::PLplot::PlotData
virtual void on_changed ()
 
virtual void on_data_modified ()
 
 PlotData ()
 
- Protected Member Functions inherited from Gtk::PLplot::Object
 Object ()
 

Protected Attributes

double datmin
 Left-hand edge of the lowest-valued bin.
 
double datmax
 Right-hand edge of the highest-valued bin.
 
int nbins
 Number of bins into which to divide the data.
 
bool expand_bins
 When false, the outer bins are drawn with equal size as the ones inside.
 
bool empty_bins
 When false, bins with zero height are not drawn (there is a gap for such bins).
 
- Protected Attributes inherited from Gtk::PLplot::PlotDataLine
Gdk::RGBA color
 The color the dataset will be drawn in.
 
LineStyle line_style
 The linestyle that will be used for this dataset in the plot.
 
double line_width
 The line width of the dataset. Default is 1.0.
 
- Protected Attributes inherited from Gtk::PLplot::PlotData
sigc::signal< void(void)> _signal_changed
 signal that gets emitted whenever any of the dataset proprties is changed.
 
sigc::signal< void(void)> _signal_data_modified
 signal that gets emitted whenever the X- and Y-datasets have been modified.
 

Private Member Functions

PlotDataHistogramoperator= (const PlotDataHistogram &)=delete
 no assignment operator
 
 PlotDataHistogram (const PlotDataHistogram &source)=delete
 no default copy constructor
 

Detailed Description

abstract base class that will hold a single dataset that can be rendered as a histogram

Base class for histogram data classes and contains common properties, accessible via getters and setters. Important is that whenever a property is changed, signal_changed() is emitted, which will eventually be picked up by the canvas that will hold the plot

Constructor & Destructor Documentation

◆ PlotDataHistogram() [1/2]

Gtk::PLplot::PlotDataHistogram::PlotDataHistogram ( const PlotDataHistogram source)
privatedelete

no default copy constructor

◆ PlotDataHistogram() [2/2]

Gtk::PLplot::PlotDataHistogram::PlotDataHistogram ( double  datmin,
double  datmax,
int  nbins,
bool  expand_bins = true,
bool  empty_bins = true 
)
protected

Constructor

PlotDataHistogram constructor.

Parameters
datminleft-hand edge of the lowest-valued bin
datmaxright-hand edge of the highest-valued bin
nbinsnumber of bins into which to divide the data (minimum = 3)
Exceptions
Gtk::PLplot::Exception
Parameters
expand_binsdetermines if outer bins will be drawn with the same width as the inner ones
empty_binsdetermines whether empty bins should be drawn

◆ ~PlotDataHistogram()

virtual Gtk::PLplot::PlotDataHistogram::~PlotDataHistogram ( )
virtual

Destructor

Member Function Documentation

◆ get_data_maximum()

double Gtk::PLplot::PlotDataHistogram::get_data_maximum ( )

Get the right-hand edge of the highest-valued bin

Returns
the requested value

◆ get_data_minimum()

double Gtk::PLplot::PlotDataHistogram::get_data_minimum ( )

Get the left-hand edge of the lowest-valued bin

Returns
the requested value

◆ get_empty_bins()

bool Gtk::PLplot::PlotDataHistogram::get_empty_bins ( )

Get current empty bins drawing behavior

Returns
the current empty bins drawing behavior

◆ get_expand_bins()

bool Gtk::PLplot::PlotDataHistogram::get_expand_bins ( )

Get current outer bins expansion behavior

Returns
the current expansion behavior

◆ get_extremes()

virtual void Gtk::PLplot::PlotDataHistogram::get_extremes ( double &  xmin,
double &  xmax,
double &  ymin,
double &  ymax 
)
pure virtual

Get dataset extremes

Will be used in determining the box and its axes

Implemented in Gtk::PLplot::PlotDataHistogramBinned, and Gtk::PLplot::PlotDataHistogramUnbinned.

◆ get_nbins()

int Gtk::PLplot::PlotDataHistogram::get_nbins ( )

Get the number of bins

Returns
the requested value

◆ operator=()

PlotDataHistogram & Gtk::PLplot::PlotDataHistogram::operator= ( const PlotDataHistogram )
privatedelete

no assignment operator

◆ set_empty_bins()

void Gtk::PLplot::PlotDataHistogram::set_empty_bins ( bool  empty_bins)

Set whether empty bins should be drawn

Parameters
empty_binsnew value

◆ set_expand_bins()

void Gtk::PLplot::PlotDataHistogram::set_expand_bins ( bool  expand_bins)

Set outer bins expansion behavior

Parameters
expand_binsthe new expansion behavior

Member Data Documentation

◆ datmax

double Gtk::PLplot::PlotDataHistogram::datmax
protected

Right-hand edge of the highest-valued bin.

◆ datmin

double Gtk::PLplot::PlotDataHistogram::datmin
protected

Left-hand edge of the lowest-valued bin.

◆ empty_bins

bool Gtk::PLplot::PlotDataHistogram::empty_bins
protected

When false, bins with zero height are not drawn (there is a gap for such bins).

◆ expand_bins

bool Gtk::PLplot::PlotDataHistogram::expand_bins
protected

When false, the outer bins are drawn with equal size as the ones inside.

◆ nbins

int Gtk::PLplot::PlotDataHistogram::nbins
protected

Number of bins into which to divide the data.