wxPlot 1.8
Real time plot library for wxWidgets
Loading...
Searching...
No Matches
wxPlot Class Reference

Main class for wxPlot. This is the only class the user going to work with. More...

#include <wxplot.hpp>

Inheritance diagram for wxPlot:

Public Member Functions

 wxPlot (wxFrame *parent, const WXPLOT_FIGURE wxPlotFigure=WXPLOT_FIGURE_2D, const WXPLOT_TYPE wxPlotType=WXPLOT_TYPE_LINE)
 Constructor of wxPlot.
 
void setFontSize (const unsigned int fontSize)
 Set the size of the fonts.
 
void setTitle (const wxString title)
 Set the title of the plot.
 
void setXlabel (const wxString xLabel)
 Set the name of the X-label.
 
void setYlabel (const wxString yLabel)
 Set the name of the Y-label.
 
void setTicks (const unsigned int ticks)
 Set the number of ticks at the figure in all axis.
 
void gridOn (const bool useGrid)
 Enable grid on the figure.
 
void setPlotStartWidth (const wxCoord plotStartWidth)
 Set the left upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
 
void setPlotStartHeight (const wxCoord plotStartHeight)
 Set the left upper corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
 
void setPlotEndWidth (const wxCoord plotEndWidth)
 Set the right upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
 
void setPlotEndHeight (const wxCoord plotEndHeight)
 Set the right bottom corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
 
void setData (const std::vector< std::vector< double > > &data2D)
 Set 2D data.
 
void setData (const std::vector< double > &data1D)
 Set 1D data.
 
void setRadius (const wxCoord radius)
 Set radius. Most used for circles e.g filling scatter plots.
 
void legendOn (const bool useLegend)
 Activate the legend.
 
void setLegend (const std::vector< wxString > &legend, const PLACEMENT legendPosition=PLACEMENT_NORTH_EAST)
 Set the labels and placement for the legend.
 
void fillCircles (const bool fillCircle)
 Fill circles if radius is applied if circiles are going to be filled with the same colour as they are drawn.
 
void setBinCount (const unsigned int binCount)
 Set the bin count for e.g. histogram.
 
void setYlim (const double minY, const double maxY)
 Set the plot zoom limit in Y-axis.
 
void drawPlot (wxPaintEvent &event)
 Important event function for draw the whole plot. Add things here, that you want to appear inside the plot for every iteration.
 

Detailed Description

Main class for wxPlot. This is the only class the user going to work with.

Constructor & Destructor Documentation

◆ wxPlot()

wxPlot::wxPlot ( wxFrame * parent,
const WXPLOT_FIGURE wxPlotFigure = WXPLOT_FIGURE_2D,
const WXPLOT_TYPE wxPlotType = WXPLOT_TYPE_LINE )

Constructor of wxPlot.

Parameters
parentThe frame which holds the plot.
wxPlotFigureSelection of plot figure e.g 2D or 3D or custom.
wxPlotTypeSelection of plot type e.g line, bar, histogram, scatter, spline etc.

Member Function Documentation

◆ drawPlot()

void wxPlot::drawPlot ( wxPaintEvent & event)

Important event function for draw the whole plot. Add things here, that you want to appear inside the plot for every iteration.

  • Step 1: Create the DC object.
  • Step 2: Draw the figure.
  • Step 3: Get the recalculated plotStartWidth, plotStartHeight, plotEndWidth and plotEndHeight from plot figure.
  • Step 4: Set the recalculated plotStartWidth, plotStartHeight, plotEndWidth and plotEndHeight to plot type.
  • Step 5: Draw plot type.
  • Step 6: Draw grid if enabled.
  • Step 7: Draw ticks if enabled.
  • Step 8: Draw legend if enabled.

For real time plotting, this function must be repeated all the time.

Parameters
eventThis event parameter is not used.

◆ fillCircles()

void wxPlot::fillCircles ( const bool fillCircle)

Fill circles if radius is applied if circiles are going to be filled with the same colour as they are drawn.

Parameters
fillCircleSet true if filled.

◆ gridOn()

void wxPlot::gridOn ( const bool useGrid)

Enable grid on the figure.

Parameters
useGridSet true for enabling grid.

◆ legendOn()

void wxPlot::legendOn ( const bool useLegend)

Activate the legend.

Parameters
useLegendSet true to make a little box with labels appear.

◆ setBinCount()

void wxPlot::setBinCount ( const unsigned int binCount)

Set the bin count for e.g. histogram.

Parameters
binCountBin count is total columns inside a e.g historam chart.

◆ setData() [1/2]

void wxPlot::setData ( const std::vector< double > & data1D)

Set 1D data.

Parameters
data1D1D data in form of 1D vector.

◆ setData() [2/2]

void wxPlot::setData ( const std::vector< std::vector< double > > & data2D)

Set 2D data.

Parameters
data2D2D data in form of 2D vector.

◆ setFontSize()

void wxPlot::setFontSize ( const unsigned int fontSize)

Set the size of the fonts.

Parameters
fontSizeThe size of the all fonts.

◆ setLegend()

void wxPlot::setLegend ( const std::vector< wxString > & legend,
const PLACEMENT legendPosition = PLACEMENT_NORTH_EAST )

Set the labels and placement for the legend.

Parameters
legendVector of strings for the legend.
legendPositionPosition where the legend should be placed.

◆ setPlotEndHeight()

void wxPlot::setPlotEndHeight ( const wxCoord plotEndHeight)

Set the right bottom corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters
plotEndHeightEnd height is at the end of Y-axis.

◆ setPlotEndWidth()

void wxPlot::setPlotEndWidth ( const wxCoord plotEndWidth)

Set the right upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters
plotEndWidthEnd width is at the end of X-axis.

◆ setPlotStartHeight()

void wxPlot::setPlotStartHeight ( const wxCoord plotStartHeight)

Set the left upper corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters
plotStartHeightStart height is at the start of Y-axis.

◆ setPlotStartWidth()

void wxPlot::setPlotStartWidth ( const wxCoord plotStartWidth)

Set the left upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters
plotStartWidthStart width is at the start of X-axis.

◆ setRadius()

void wxPlot::setRadius ( const wxCoord radius)

Set radius. Most used for circles e.g filling scatter plots.

Parameters
radiusThe radius of the circle.

◆ setTicks()

void wxPlot::setTicks ( const unsigned int ticks)

Set the number of ticks at the figure in all axis.

Parameters
ticksNumber of ticks.

◆ setTitle()

void wxPlot::setTitle ( const wxString title)

Set the title of the plot.

Parameters
titleName of the title.

◆ setXlabel()

void wxPlot::setXlabel ( const wxString xLabel)

Set the name of the X-label.

Parameters
xLabelName of the X-label.

◆ setYlabel()

void wxPlot::setYlabel ( const wxString yLabel)

Set the name of the Y-label.

Parameters
yLabelName of the Y-label.

◆ setYlim()

void wxPlot::setYlim ( const double minY,
const double maxY )

Set the plot zoom limit in Y-axis.

Parameters
minYMinimum limit in Y-axis.
maxYMaximum limit in Y-axis.

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