Public Member Functions | List of all members
XYGraph Class Reference

Class for XY-type simple graph plots. More...

#include <xygraph.hpp>

Inheritance diagram for XYGraph:
Graph

Public Member Functions

 XYGraph ()
 Default constructor for empty graph.
 XYGraph (const std::vector< double > &xdata, const std::vector< double > &ydata)
 Constructor for basic graph with datapoints xdata and ydata.
virtual ~XYGraph ()
 Destructor.
virtual void plot (cairo_t *cairo, const Coordmapper *cm, const double range[4])
 Plot graph with cairo.
virtual void plot_sample (cairo_t *cairo, double x, double y, double width, double height)
 Plot sample for legend.
virtual void get_bbox (double bbox[4])
 Get bounding box of graph.
void set_data (const std::vector< double > &xdata, const std::vector< double > &ydata)
 Set new data arrays.
void set_line_width (double linewidth)
 Set line width.
void set_color (const Color &color)
 Set graph color.
void set_line_style (line_style_e linestyle, double linewidth=1.0)
 Set line style.
void set_point_style (point_style_e pointstyle, bool filled=true, double scale=1.0)
 Set point style.
- Public Member Functions inherited from Graph
virtual ~Graph ()
 Virtual destructor.

Detailed Description

Class for XY-type simple graph plots.

Implementation of Graph. Used in Frame type plots.

Constructor & Destructor Documentation

XYGraph::XYGraph ( )

Default constructor for empty graph.

XYGraph::XYGraph ( const std::vector< double > &  xdata,
const std::vector< double > &  ydata 
)

Constructor for basic graph with datapoints xdata and ydata.

Internal copies of the data from xdata and ydata are made.

virtual XYGraph::~XYGraph ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void XYGraph::get_bbox ( double  bbox[4])
virtual

Get bounding box of graph.

Returns the bounding box of the graph in array bbox in order xmin, ymin, xmax, ymax.

Implements Graph.

virtual void XYGraph::plot ( cairo_t *  cairo,
const Coordmapper cm,
const double  range[4] 
)
virtual

Plot graph with cairo.

Plot the graph using cairo and coordinate mapper cm. The visible range of plot is given in array range in order xmin, ymin, xmax, ymax. The graph should be able to handle any range values. Also min > max.

Called by Frame during drawing.

Implements Graph.

virtual void XYGraph::plot_sample ( cairo_t *  cairo,
double  x,
double  y,
double  width,
double  height 
)
virtual

Plot sample for legend.

Plot graph sample for legend at cairo coordinates (x,y).

Implements Graph.

void XYGraph::set_color ( const Color color)

Set graph color.

Defaults to red (1,0,0).

void XYGraph::set_data ( const std::vector< double > &  xdata,
const std::vector< double > &  ydata 
)

Set new data arrays.

void XYGraph::set_line_style ( line_style_e  linestyle,
double  linewidth = 1.0 
)

Set line style.

Defaults to no lines drawn (XYGRAPH_LINE_DISABLE)

void XYGraph::set_line_width ( double  linewidth)

Set line width.

Default to width 1.0.

void XYGraph::set_point_style ( point_style_e  pointstyle,
bool  filled = true,
double  scale = 1.0 
)

Set point style.

Defaults to filled XYGRAPH_POINT_CIRCLE with scale 3.0.


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