QwtPlot(3) | Qwt User's Guide | QwtPlot(3) |
QwtPlot -
#include <qwt_plot.h>
Inherits QwtPlotDict.
enum Axis { yLeft, yRight, xBottom,
xTop, axisCnt }
enum LegendPosition { LeftLegend, RightLegend,
BottomLegend, TopLegend, ExternalLegend }
void autoRefresh ()
virtual void clear ()
virtual void replot ()
void legendChecked (QwtPlotItem *plotItem, bool on)
void legendClicked (QwtPlotItem *plotItem)
QwtPlot (QWidget *=NULL)
QwtPlot (const QwtText &title, QWidget *p=NULL)
virtual ~QwtPlot ()
void applyProperties (const QString &)
bool autoReplot () const
bool axisAutoScale (int axisId) const
bool axisEnabled (int axisId) const
QFont axisFont (int axisId) const
int axisMaxMajor (int axisId) const
int axisMaxMinor (int axisId) const
const QwtScaleDiv * axisScaleDiv (int axisId) const
QwtScaleDiv * axisScaleDiv (int axisId)
const QwtScaleDraw * axisScaleDraw (int axisId) const
QwtScaleDraw * axisScaleDraw (int axisId)
QwtScaleEngine * axisScaleEngine (int axisId)
const QwtScaleEngine * axisScaleEngine (int axisId) const
double axisStepSize (int axisId) const
QwtText axisTitle (int axisId) const
const QwtScaleWidget * axisWidget (int axisId) const
QwtScaleWidget * axisWidget (int axisId)
QwtPlotCanvas * canvas ()
const QwtPlotCanvas * canvas () const
const QColor & canvasBackground () const
int canvasLineWidth () const
virtual QwtScaleMap canvasMap (int axisId) const
virtual void drawCanvas (QPainter *)
void enableAxis (int axisId, bool tf=true)
virtual bool event (QEvent *)
QString grabProperties () const
void insertLegend (QwtLegend *,
LegendPosition=QwtPlot::RightLegend, double ratio=-1.0)
double invTransform (int axisId, int pos) const
QwtLegend * legend ()
const QwtLegend * legend () const
int margin () const
virtual QSize minimumSizeHint () const
QwtPlotLayout * plotLayout ()
const QwtPlotLayout * plotLayout () const
virtual void polish ()
void print (QPaintDevice &p, const QwtPlotPrintFilter
&=QwtPlotPrintFilter()) const
virtual void print (QPainter *, const QRect &rect, const
QwtPlotPrintFilter &=QwtPlotPrintFilter()) const
void setAutoReplot (bool tf=true)
void setAxisAutoScale (int axisId)
void setAxisFont (int axisId, const QFont &f)
void setAxisLabelAlignment (int axisId, Qt::Alignment)
void setAxisLabelRotation (int axisId, double rotation)
void setAxisMaxMajor (int axisId, int maxMajor)
void setAxisMaxMinor (int axisId, int maxMinor)
void setAxisScale (int axisId, double min, double max, double step=0)
void setAxisScaleDiv (int axisId, const QwtScaleDiv &)
void setAxisScaleDraw (int axisId, QwtScaleDraw *)
void setAxisScaleEngine (int axisId, QwtScaleEngine *)
void setAxisTitle (int axisId, const QString &)
void setAxisTitle (int axisId, const QwtText &)
void setCanvasBackground (const QColor &c)
void setCanvasLineWidth (int w)
void setMargin (int margin)
void setTitle (const QString &)
void setTitle (const QwtText &t)
virtual QSize sizeHint () const
QwtText title () const
QwtTextLabel * titleLabel ()
const QwtTextLabel * titleLabel () const
int transform (int axisId, double value) const
void updateAxes ()
virtual void updateLayout ()
virtual void legendItemChecked (bool)
virtual void legendItemClicked ()
virtual void drawItems (QPainter *, const QRect &,
const QwtScaleMap maps[axisCnt], const QwtPlotPrintFilter
&) const
virtual void printCanvas (QPainter *, const QRect &boundingRect,
const QRect &canvasRect, const QwtScaleMap maps[axisCnt], const
QwtPlotPrintFilter &) const
virtual void printLegend (QPainter *, const QRect &) const
virtual void printLegendItem (QPainter *, const QWidget *, const QRect
&) const
virtual void printScale (QPainter *, int axisId, int startDist, int
endDist, int baseDist, const QRect &) const
virtual void printTitle (QPainter *, const QRect &) const
virtual void resizeEvent (QResizeEvent *e)
virtual void updateTabOrder ()
static bool axisValid (int axisId)
A 2-D plotting widget.
QwtPlot is a widget for plotting two-dimensional graphs. An unlimited number of plot items can be displayed on its canvas. Plot items might be curves (QwtPlotCurve), markers (QwtPlotMarker), the grid (QwtPlotGrid), or anything else derived from QwtPlotItem. A plot can have up to four axes, with each plot item attached to an x- and a y axis. The scales at the axes can be explicitly set (QwtScaleDiv), or are calculated from the plot items, using algorithms (QwtScaleEngine) which can be configured separately for each axis.
Example
#include <qwt_plot.h> #include <qwt_plot_curve.h> QwtPlot *myPlot = new QwtPlot("Two Curves", parent); // add curves QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2"); // copy the data into the curves curve1->setData(...); curve2->setData(...); curve1->attach(myPlot); curve2->attach(myPlot); // finally, refresh the plot myPlot->replot();
Axis index
Position of the legend, relative to the canvas.
Note:
See also:
Constructor. Parameters:
Constructor. Parameters:
This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin.
Warning:
Returns:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Return the scale division of a specified axis. axisScaleDiv(axisId)->lowerBound(), axisScaleDiv(axisId)->upperBound() are the current limits of the axis scale.
Parameters:
Returns:
See also:
Return the scale division of a specified axis. axisScaleDiv(axisId)->lowerBound(), axisScaleDiv(axisId)->upperBound() are the current limits of the axis scale.
Parameters:
Returns:
See also:
Returns:
Parameters:
Returns:
See also:
Returns:
Parameters:
Returns:
See also:
Parameters:
Returns:
Parameters:
Returns:
Return the step size parameter, that has been set in setAxisScale. This doesn't need to be the step size of the current scale.
Parameters:
Returns:
See also:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Returns:
Nothing else than: canvas()->palette().color( QPalette::Normal, QColorGroup::Background);
Returns:
Nothing else than: canvas()->lineWidth(), left for compatibility only.
Returns:
Parameters:
Returns:
See also:
Remove all curves and markers
Deprecated
Redraw the canvas.
Parameters:
Warning:
See also:
Redraw the canvas items.
Parameters:
Enable or disable a specified axis. When an axis is disabled, this only means that it is not visible on the screen. Curves, markers and can be attached to disabled axes, and transformation of screen coordinates into values works as normal.
Only xBottom and yLeft are enabled by default.
Parameters:
This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin.
Warning:
Insert a legend. If the position legend is QwtPlot::LeftLegend or QwtPlot::RightLegend the legend will be organized in one column from top to down. Otherwise the legend items will be placed in a table with a best fit number of columns from left to right.
If pos != QwtPlot::ExternalLegend the plot widget will become parent of the legend. It will be deleted when the plot is deleted, or another legend is set with insertLegend().
Parameters:
See also:
Transform the x or y coordinate of a position in the drawing region into a value.
Parameters:
Warning:
Returns:
See also:
Returns:
See also:
A signal which is emitted when the user has clicked on a legend item, which is in QwtLegend::CheckableItem mode
Parameters:
Note:
See also:
A signal which is emitted when the user has clicked on a legend item, which is in QwtLegend::ClickableItem mode.
Parameters:
Note:
See also:
Called internally when the legend has been checked Emits a legendClicked() signal.
Called internally when the legend has been clicked on. Emits a legendClicked() signal.
Returns:
See also:
Returns:
Returns:
Print the plot to a QPaintDevice (QPrinter) This function prints the contents of a QwtPlot instance to QPaintDevice object. The size is derived from its device metrics. Parameters:
See also:
Paint the plot into a given rectangle. Paint the contents of a QwtPlot instance into a given rectangle. Parameters:
See also:
Print the canvas into a given rectangle.
Parameters:
See also:
Print the legend into a given rectangle.
Parameters:
Print the legend item into a given rectangle.
Parameters:
Paint a scale into a given rectangle. Paint the scale into a given rectangle. Parameters:
Print the title into a given rectangle.
Parameters:
Redraw the plot. If the autoReplot option is not set (which is the default) or if any curves are attached to raw data, the plot has to be refreshed explicitly in order to make changes visible.
See also:
Warning:
Resize and update internal layout
Parameters:
Set or reset the autoReplot option. If the autoReplot option is set, the plot will be updated implicitly by manipulating member functions. Since this may be time-consuming, it is recommended to leave this option switched off and call replot() explicitly if necessary.
The autoReplot option is set to false by default, which means that the user has to call replot() in order to make changes visible.
Parameters:
See also:
Enable autoscaling for a specified axis. This member function is used to switch back to autoscaling mode after a fixed scale has been set. Autoscaling is enabled by default.
Parameters:
See also:
Change the font of an axis. Parameters:
Warning:
Change the alignment of the tick labels
Parameters:
See also:
Rotate all tick labels
Parameters:
See also:
Set the maximum number of major scale intervals for a specified axis
Parameters:
See also:
Set the maximum number of minor scale intervals for a specified axis
Parameters:
See also:
Disable autoscaling and specify a fixed scale for a selected axis. Parameters:
See also:
Disable autoscaling and specify a fixed scale for a selected axis. Parameters:
See also:
Set a scale draw. Parameters:
By passing scaleDraw it is possible to extend QwtScaleDraw functionality and let it take place in QwtPlot. Please note that scaleDraw has to be created with new and will be deleted by the corresponding QwtScale member ( like a child object ).
See also:
Warning:
Change the scale engine for an axis
Parameters:
See also:
Change the title of a specified axis. Parameters:
Change the title of a specified axis. Parameters:
Change the background of the plotting area. Sets c to QColorGroup::Background of all colorgroups of the palette of the canvas. Using canvas()->setPalette() is a more powerful way to set these colors.
Parameters:
Change the border width of the plotting area Nothing else than canvas()->setLineWidth(w), left for compatibility only. Parameters:
Change the margin of the plot. The margin is the space around all components.
Parameters:
See also:
Change the plot's title
Parameters:
Change the plot's title
Parameters:
Return sizeHint
See also:
Returns:
Returns:
Returns:
Transform a value into a coordinate in the plotting region. Parameters:
Returns:
Adjust plot content to its current size. See also:
Update the focus tab order
The order is changed so that the canvas will be in front of the first legend item, or behind the last legend item - depending on the position of the legend.
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Tue Nov 20 2012 | Version 5.2.3 |