ecolab::Plot Class Reference
Inheritance diagram for ecolab::Plot:
Inheritance graph
Collaboration diagram for ecolab::Plot:
Collaboration graph

Classes

struct  XFY
 

Public Types

enum  Side { left, right }
 
enum  PlotType { line, bar }
 

Public Member Functions

double labelheight () const
 height (or width) of an axis label in pixels
 
double lh (double width, double height) const
 
cairo_surface_t * cairoSurface () const
 
int width () const
 
int height () const
 
void setMinMax ()
 set min/max to autoscale on contained data
 
string Image () const
 set/get the Tk image that this class writes to.
 
string Image (const string &im, bool transparency=true)
 
string image (TCL_args args)
 
void redraw ()
 redraw the plot
 
virtual void draw (cairo::Surface &)
 draw the plot onto a given surface
 
void draw (cairo_t *, double width, double height) const
 
void clear ()
 clear all datapoints (and redraw)
 
void add (unsigned pen, double x, double y)
 add a datapoint
 
void add (cairo::Surface &, unsigned pen, double x, double y)
 
template<class C >
void add (unsigned pen, const C &x, const C &y)
 add multiple points (C=container - eg vector/array)
 
template<class C >
void add (cairo::Surface &surf, unsigned pen, const C &x1, const C &y1)
 
void add (const array_ns::array< unsigned > &pens, double x, const array_ns::array< double > &y)
 add multiple pens worth of data in one hit
 
void add (cairo::Surface &surf, const array_ns::array< unsigned > &pens, double x1, const array_ns::array< double > &y1)
 
void labelPen (unsigned pen, const string &label)
 
void LabelPen (unsigned pen, const cairo::SurfacePtr &label)
 label a pen with an arbitrary graphic, given by label.
 
void AssignSide (unsigned pen, Side)
 assign a side to display the scale for pen
 
void assignSide (TCL_args args)
 
void clearPenAttributes ()
 remove all pen labels and side associations
 
void plot (TCL_args args)
 TCL interface.
 
void pack (classdesc::pack_t &p) const
 
void unpack (classdesc::pack_t &p)
 
void addPt (unsigned pen, double x, double y)
 

Public Attributes

int nxTicks
 
int nyTicks
 number of x/y-axis ticks
 
double fontScale
 scale tick labels
 
double offx
 
double offy
 origin of plot within image
 
bool logx
 
bool logy
 logarithmic plots (x/y axes)
 
bool grid
 
bool subgrid
 draw grid options
 
bool leadingMarker
 draw a leading marker on the curve (full draw only)
 
bool autoscale
 autoscale plot to data
 
bool legend
 add a legend to the plot
 
Side legendSide
 legend drawn towards the left or right
 
PlotType plotType
 
string xlabel
 axis labels
 
string ylabel
 
string y1label
 
double minx
 plot bounding box. y1 refers to the right hand scale
 
double maxx
 
double miny
 
double maxy
 
double miny1
 
double maxy1
 

Member Function Documentation

◆ labelPen()

void ecolab::Plot::labelPen ( unsigned  pen,
const string &  label 
)

label a pen (for display in a legend). The string may contain pango markup.


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