Multiplot  0.5.5
Public Member Functions | Public Attributes | List of all members
multiplot::Multiplot::Trace Class Reference

#include <multiplot.h>

Inheritance diagram for multiplot::Multiplot::Trace:

Public Member Functions

void draw (Point2d &minimum, Point2d &maximum, Point2d &scale, Point2d &offset)
 
void plot (const float x, const float y)
 
void color3f (float r, float g, float b)
 
void set_linewidth (float width)
 
void set_pointsize (float psize)
 
void set_max_points (int mx)
 
void set_scrolling (int max_points_to_plot)
 
void clear ()
 

Public Attributes

unsigned int max_points
 
bool scroll
 
unsigned int pos
 
float cur_col [3]
 
float cur_line_width
 
float cur_point_size
 

Detailed Description

class Trace describes a single Trace. A Multiplot-Window can contain an unlimited number of Traces.

Member Function Documentation

◆ clear()

void multiplot::Multiplot::Trace::clear ( )
inline

clear() removes all points from the trace. the trace is empty afterwards and can be filled with plot(x,y) again.

◆ color3f()

void multiplot::Multiplot::Trace::color3f ( float  r,
float  g,
float  b 
)
inline

sets the current drawing color in rgb format. r,g,b are in the range [0..1]

◆ plot()

void multiplot::Multiplot::Trace::plot ( const float  x,
const float  y 
)
inline

plot a point at (x,y) to the currently active trace. you may switch the trace with a call to trace(int _trace)

◆ set_linewidth()

void multiplot::Multiplot::Trace::set_linewidth ( float  width)
inline

call set_linewidth to change the thickness of the traces. the default value is 1 pixel, if you set the linewidth to zero, no lines are drawn. this is usefull to create scatter-plots.

◆ set_max_points()

void multiplot::Multiplot::Trace::set_max_points ( int  mx)
inline

set the maximum number of points to be plotted. this is useful to avoid slow drawing of your trace. if you have 1000 plot-points and set the number of max_points to 100, then only every tenth point gets plotted.

◆ set_pointsize()

void multiplot::Multiplot::Trace::set_pointsize ( float  psize)
inline

this function sets the size of the plot-points. the default value is zero, so no points are drawn at all. if you wish to create a scatter-plot, set the pointsize to a value bigger than zero and the linesize to zero.

◆ set_scrolling()

void multiplot::Multiplot::Trace::set_scrolling ( int  max_points_to_plot)
inline

if you call set_scrolling with a positive number of points to be plotted, your graph will scroll left out of the plot-window as you add new plot-points. Zero or a negative number disables scrolling.


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