Qwt User's Guide
QwtPlot Class Reference

A 2-D plotting widget. More...

#include <qwt_plot.h>

Inheritance diagram for QwtPlot:

Public Types

enum  Axis {
  yLeft, yRight, xBottom, xTop,
  axisCnt
}
 Axis index. More...
enum  LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend }

Public Slots

virtual void replot ()
 Redraw the plot.
void autoRefresh ()
 Replots the plot if autoReplot() is true.

Signals

void itemAttached (QwtPlotItem *plotItem, bool on)
void legendDataChanged (const QVariant &itemInfo, const QList< QwtLegendData > &data)

Public Member Functions

 QwtPlot (QWidget *=NULL)
 Constructor.
 QwtPlot (const QwtText &title, QWidget *=NULL)
 Constructor.
virtual ~QwtPlot ()
 Destructor.
void applyProperties (const QString &)
QString grabProperties () const
void setAutoReplot (bool=true)
 Set or reset the autoReplot option.
bool autoReplot () const
void setPlotLayout (QwtPlotLayout *)
 Assign a new plot layout.
QwtPlotLayoutplotLayout ()
const QwtPlotLayoutplotLayout () const
void setTitle (const QString &)
void setTitle (const QwtText &t)
QwtText title () const
QwtTextLabeltitleLabel ()
const QwtTextLabeltitleLabel () const
void setFooter (const QString &)
void setFooter (const QwtText &t)
QwtText footer () const
QwtTextLabelfooterLabel ()
const QwtTextLabelfooterLabel () const
void setCanvas (QWidget *)
 Set the drawing canvas of the plot widget.
QWidget * canvas ()
const QWidget * canvas () const
void setCanvasBackground (const QBrush &)
 Change the background of the plotting area.
QBrush canvasBackground () const
virtual QwtScaleMap canvasMap (int axisId) const
double invTransform (int axisId, int pos) const
double transform (int axisId, double value) const
 Transform a value into a coordinate in the plotting region.
QwtScaleEngineaxisScaleEngine (int axisId)
const QwtScaleEngineaxisScaleEngine (int axisId) const
void setAxisScaleEngine (int axisId, QwtScaleEngine *)
void setAxisAutoScale (int axisId, bool on=true)
 Enable autoscaling for a specified axis.
bool axisAutoScale (int axisId) const
void enableAxis (int axisId, bool tf=true)
 Enable or disable a specified axis.
bool axisEnabled (int axisId) const
void setAxisFont (int axisId, const QFont &f)
 Change the font of an axis.
QFont axisFont (int axisId) const
void setAxisScale (int axisId, double min, double max, double step=0)
 Disable autoscaling and specify a fixed scale for a selected axis.
void setAxisScaleDiv (int axisId, const QwtScaleDiv &)
 Disable autoscaling and specify a fixed scale for a selected axis.
void setAxisScaleDraw (int axisId, QwtScaleDraw *)
 Set a scale draw.
double axisStepSize (int axisId) const
 Return the step size parameter that has been set in setAxisScale.
QwtInterval axisInterval (int axisId) const
 Return the current interval of the specified axis.
const QwtScaleDivaxisScaleDiv (int axisId) const
 Return the scale division of a specified axis.
const QwtScaleDrawaxisScaleDraw (int axisId) const
 Return the scale draw of a specified axis.
QwtScaleDrawaxisScaleDraw (int axisId)
 Return the scale draw of a specified axis.
const QwtScaleWidgetaxisWidget (int axisId) const
QwtScaleWidgetaxisWidget (int axisId)
void setAxisLabelAlignment (int axisId, Qt::Alignment)
void setAxisLabelRotation (int axisId, double rotation)
void setAxisTitle (int axisId, const QString &)
 Change the title of a specified axis.
void setAxisTitle (int axisId, const QwtText &)
 Change the title of a specified axis.
QwtText axisTitle (int axisId) const
void setAxisMaxMinor (int axisId, int maxMinor)
int axisMaxMinor (int axisId) const
void setAxisMaxMajor (int axisId, int maxMajor)
int axisMaxMajor (int axisId) const
void insertLegend (QwtAbstractLegend *, LegendPosition=QwtPlot::RightLegend, double ratio=-1.0)
 Insert a legend.
QwtAbstractLegendlegend ()
const QwtAbstractLegendlegend () const
void updateLegend ()
void updateLegend (const QwtPlotItem *)
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
 Return a minimum size hint.
virtual void updateLayout ()
 Adjust plot content to its current size.
virtual void drawCanvas (QPainter *)
void updateAxes ()
 Rebuild the axes scales.
void updateCanvasMargins ()
 Update the canvas margins.
virtual void getCanvasMarginsHint (const QwtScaleMap maps[], const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const
 Calculate the canvas margins.
virtual bool event (QEvent *)
 Adds handling of layout requests.
virtual bool eventFilter (QObject *, QEvent *)
 Event filter.
virtual void drawItems (QPainter *, const QRectF &, const QwtScaleMap maps[axisCnt]) const
virtual QVariant itemToInfo (QwtPlotItem *) const
 Build an information, that can be used to identify a plot item on the legend.
virtual QwtPlotIteminfoToItem (const QVariant &) const
 Identify the plot item according to an item info object, that has bee generated from itemToInfo().

Protected Member Functions

virtual void resizeEvent (QResizeEvent *e)

Static Protected Member Functions

static bool axisValid (int axisId)

Detailed Description

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.

The simpleplot example is a good starting point to see how to set up a plot widget.

plot.png
Example
The following example shows (schematically) the most simple way to use QwtPlot. By default, only the left and bottom axes are visible and their scales are computed automatically.
#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");

// connect or copy the data to the curves
curve1->setData(...);
curve2->setData(...);

curve1->attach(myPlot);
curve2->attach(myPlot);

// finally, refresh the plot
myPlot->replot();

Member Enumeration Documentation

Axis index.

Enumerator:
yLeft 

Y axis left of the canvas.

yRight 

Y axis right of the canvas.

xBottom 

X axis below the canvas.

xTop 

X axis above the canvas.

axisCnt 

Number of axes.

Position of the legend, relative to the canvas.

See also:
insertLegend()
Enumerator:
LeftLegend 

The legend will be left from the QwtPlot::yLeft axis.

RightLegend 

The legend will be right from the QwtPlot::yRight axis.

BottomLegend 

The legend will be below the footer.

TopLegend 

The legend will be above the title.


Constructor & Destructor Documentation

QwtPlot::QwtPlot ( QWidget *  parent = NULL) [explicit]

Constructor.

Parameters:
parentParent widget
QwtPlot::QwtPlot ( const QwtText title,
QWidget *  parent = NULL 
) [explicit]

Constructor.

Parameters:
titleTitle text
parentParent widget

Member Function Documentation

void QwtPlot::applyProperties ( const QString &  )

This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin.

Warning:
The plot editor has never been implemented.
bool QwtPlot::autoReplot ( ) const
Returns:
true if the autoReplot option is set.
See also:
setAutoReplot()
bool QwtPlot::axisAutoScale ( int  axisId) const
Returns:
True, if autoscaling is enabled
Parameters:
axisIdAxis index
bool QwtPlot::axisEnabled ( int  axisId) const
Returns:
True, if a specified axis is enabled
Parameters:
axisIdAxis index
QFont QwtPlot::axisFont ( int  axisId) const
Returns:
The font of the scale labels for a specified axis
Parameters:
axisIdAxis index
QwtInterval QwtPlot::axisInterval ( int  axisId) const

Return the current interval of the specified axis.

This is only a convenience function for axisScaleDiv( axisId )->interval();

Parameters:
axisIdAxis index
Returns:
Scale interval
See also:
QwtScaleDiv, axisScaleDiv()
int QwtPlot::axisMaxMajor ( int  axisId) const
Returns:
The maximum number of major ticks for a specified axis
Parameters:
axisIdAxis index
See also:
setAxisMaxMajor(), QwtScaleEngine::divideScale()
int QwtPlot::axisMaxMinor ( int  axisId) const
Returns:
the maximum number of minor ticks for a specified axis
Parameters:
axisIdAxis index
See also:
setAxisMaxMinor(), QwtScaleEngine::divideScale()
const QwtScaleDiv & QwtPlot::axisScaleDiv ( int  axisId) const

Return the scale division of a specified axis.

axisScaleDiv(axisId).lowerBound(), axisScaleDiv(axisId).upperBound() are the current limits of the axis scale.

Parameters:
axisIdAxis index
Returns:
Scale division
See also:
QwtScaleDiv, setAxisScaleDiv(), QwtScaleEngine::divideScale()
const QwtScaleDraw * QwtPlot::axisScaleDraw ( int  axisId) const

Return the scale draw of a specified axis.

Parameters:
axisIdAxis index
Returns:
Specified scaleDraw for axis, or NULL if axis is invalid.

Return the scale draw of a specified axis.

Parameters:
axisIdAxis index
Returns:
Specified scaleDraw for axis, or NULL if axis is invalid.
Parameters:
axisIdAxis index
Returns:
Scale engine for a specific axis
const QwtScaleEngine * QwtPlot::axisScaleEngine ( int  axisId) const
Parameters:
axisIdAxis index
Returns:
Scale engine for a specific axis
double QwtPlot::axisStepSize ( int  axisId) const

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:
axisIdAxis index
Returns:
step size parameter value
See also:
setAxisScale(), QwtScaleEngine::divideScale()
QwtText QwtPlot::axisTitle ( int  axisId) const
Returns:
Title of a specified axis
Parameters:
axisIdAxis index
bool QwtPlot::axisValid ( int  axisId) [static, protected]
Returns:
true if the specified axis exists, otherwise false
Parameters:
axisIdaxis index
const QwtScaleWidget * QwtPlot::axisWidget ( int  axisId) const
Returns:
Scale widget of the specified axis, or NULL if axisId is invalid.
Parameters:
axisIdAxis index
Returns:
Scale widget of the specified axis, or NULL if axisId is invalid.
Parameters:
axisIdAxis index
QWidget * QwtPlot::canvas ( )
Returns:
the plot's canvas
const QWidget * QwtPlot::canvas ( ) const
Returns:
the plot's canvas
QBrush QwtPlot::canvasBackground ( ) const

Nothing else than: canvas()->palette().brush( QPalette::Normal, QPalette::Window);

Returns:
Background brush of the plotting area.
See also:
setCanvasBackground()
QwtScaleMap QwtPlot::canvasMap ( int  axisId) const [virtual]
Parameters:
axisIdAxis
Returns:
Map for the axis on the canvas. With this map pixel coordinates can translated to plot coordinates and vice versa.
See also:
QwtScaleMap, transform(), invTransform()
void QwtPlot::drawCanvas ( QPainter *  painter) [virtual]

Redraw the canvas.

Parameters:
painterPainter used for drawing
Warning:
drawCanvas calls drawItems what is also used for printing. Applications that like to add individual plot items better overload drawItems()
See also:
drawItems()
void QwtPlot::drawItems ( QPainter *  painter,
const QRectF &  canvasRect,
const QwtScaleMap  maps[axisCnt] 
) const [virtual]

Redraw the canvas items.

Parameters:
painterPainter used for drawing
canvasRectBounding rectangle where to paint
mapsQwtPlot::axisCnt maps, mapping between plot and paint device coordinates
Note:
Usually canvasRect is contentsRect() of the plot canvas. Due to a bug in Qt this rectangle might be wrong for certain frame styles ( f.e QFrame::Box ) and it might be necessary to fix the margins manually using QWidget::setContentsMargins()
void QwtPlot::enableAxis ( int  axisId,
bool  tf = true 
)

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:
axisIdAxis index
tftrue (enabled) or false (disabled)
bool QwtPlot::event ( QEvent *  event) [virtual]

Adds handling of layout requests.

Parameters:
eventEvent
Returns:
See QFrame::event()
bool QwtPlot::eventFilter ( QObject *  object,
QEvent *  event 
) [virtual]

Event filter.

The plot handles the following events for the canvas:

  • QEvent::Resize The canvas margins might depend on its size
  • QEvent::ContentsRectChange The layout needs to be recalculated
Parameters:
objectObject to be filtered
eventEvent
Returns:
See QFrame::eventFilter()
See also:
updateCanvasMargins(), updateLayout()
Returns:
Text of the footer
Returns:
Footer label widget.
Returns:
Footer label widget.
void QwtPlot::getCanvasMarginsHint ( const QwtScaleMap  maps[],
const QRectF &  canvasRect,
double &  left,
double &  top,
double &  right,
double &  bottom 
) const [virtual]

Calculate the canvas margins.

Parameters:
mapsQwtPlot::axisCnt maps, mapping between plot and paint device coordinates
canvasRectBounding rectangle where to paint
leftReturn parameter for the left margin
topReturn parameter for the top margin
rightReturn parameter for the right margin
bottomReturn parameter for the bottom margin

Plot items might indicate, that they need some extra space at the borders of the canvas by the QwtPlotItem::Margins flag.

updateCanvasMargins(), QwtPlotItem::getCanvasMarginHint()

QString QwtPlot::grabProperties ( ) const

This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin.

Returns:
QString::null
Warning:
The plot editor has never been implemented.
QwtPlotItem * QwtPlot::infoToItem ( const QVariant &  itemInfo) const [virtual]

Identify the plot item according to an item info object, that has bee generated from itemToInfo().

The default implementation simply tries to unwrap a QwtPlotItem pointer:

    if ( itemInfo.canConvert<QwtPlotItem *>() )
        return qvariant_cast<QwtPlotItem *>( itemInfo );
Parameters:
itemInfoPlot item
Returns:
A plot item, when successful, otherwise a NULL pointer.
See also:
itemToInfo()
void QwtPlot::insertLegend ( QwtAbstractLegend legend,
QwtPlot::LegendPosition  pos = QwtPlot::RightLegend,
double  ratio = -1.0 
)

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.

insertLegend() will set the plot widget as parent for the legend. The legend will be deleted in the destructor of the plot or when another legend is inserted.

Legends, that are not inserted into the layout of the plot widget need to connect to the legendDataChanged() signal. Calling updateLegend() initiates this signal for an initial update. When the application code wants to implement its own layout this also needs to be done for rendering plots to a document ( see QwtPlotRenderer ).

Parameters:
legendLegend
posThe legend's position. For top/left position the number of columns will be limited to 1, otherwise it will be set to unlimited.
ratioRatio between legend and the bounding rectangle of title, canvas and axes. The legend will be shrunk if it would need more space than the given ratio. The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0 it will be reset to the default ratio. The default vertical/horizontal ratio is 0.33/0.5.
See also:
legend(), QwtPlotLayout::legendPosition(), QwtPlotLayout::setLegendPosition()
double QwtPlot::invTransform ( int  axisId,
int  pos 
) const

Transform the x or y coordinate of a position in the drawing region into a value.

Parameters:
axisIdAxis index
posposition
Returns:
Position as axis coordinate
Warning:
The position can be an x or a y coordinate, depending on the specified axis.
void QwtPlot::itemAttached ( QwtPlotItem plotItem,
bool  on 
) [signal]

A signal indicating, that an item has been attached/detached

Parameters:
plotItemPlot item
onAttached/Detached
QVariant QwtPlot::itemToInfo ( QwtPlotItem plotItem) const [virtual]

Build an information, that can be used to identify a plot item on the legend.

The default implementation simply wraps the plot item into a QVariant object. When overloading itemToInfo() usually infoToItem() needs to reimplemeted too.

    QVariant itemInfo;
    qVariantSetValue( itemInfo, plotItem );
Parameters:
plotItemPlot item
Returns:
Plot item embedded in a QVariant
See also:
infoToItem()
Returns:
the plot's legend
See also:
insertLegend()
Returns:
the plot's legend
See also:
insertLegend()
void QwtPlot::legendDataChanged ( const QVariant &  itemInfo,
const QList< QwtLegendData > &  data 
) [signal]

A signal with the attributes how to update the legend entries for a plot item.

Parameters:
itemInfoInfo about a plot item, build from itemToInfo()
dataAttributes of the entries ( usually <= 1 ) for the plot item.
See also:
itemToInfo(), infoToItem(), QwtAbstractLegend::updateLegend()
Returns:
the plot's layout
Returns:
the plot's layout
void QwtPlot::replot ( ) [virtual, slot]

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:
updateAxes(), setAutoReplot()
void QwtPlot::resizeEvent ( QResizeEvent *  e) [protected, virtual]

Resize and update internal layout

Parameters:
eResize event
void QwtPlot::setAutoReplot ( bool  tf = true)

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:
tftrue or false. Defaults to true.
See also:
replot()
void QwtPlot::setAxisAutoScale ( int  axisId,
bool  on = true 
)

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:
axisIdAxis index
onOn/Off
See also:
setAxisScale(), setAxisScaleDiv(), updateAxes()
Note:
The autoscaling flag has no effect until updateAxes() is executed ( called by replot() ).
void QwtPlot::setAxisFont ( int  axisId,
const QFont &  font 
)

Change the font of an axis.

Parameters:
axisIdAxis index
fontFont
Warning:
This function changes the font of the tick labels, not of the axis title.
void QwtPlot::setAxisLabelAlignment ( int  axisId,
Qt::Alignment  alignment 
)

Change the alignment of the tick labels

Parameters:
axisIdAxis index
alignmentOr'd Qt::AlignmentFlags see <qnamespace.h>
See also:
QwtScaleDraw::setLabelAlignment()
void QwtPlot::setAxisLabelRotation ( int  axisId,
double  rotation 
)

Rotate all tick labels

Parameters:
axisIdAxis index
rotationAngle in degrees. When changing the label rotation, the label alignment might be adjusted too.
See also:
QwtScaleDraw::setLabelRotation(), setAxisLabelAlignment()
void QwtPlot::setAxisMaxMajor ( int  axisId,
int  maxMajor 
)

Set the maximum number of major scale intervals for a specified axis

Parameters:
axisIdAxis index
maxMajorMaximum number of major steps
See also:
axisMaxMajor()
void QwtPlot::setAxisMaxMinor ( int  axisId,
int  maxMinor 
)

Set the maximum number of minor scale intervals for a specified axis

Parameters:
axisIdAxis index
maxMinorMaximum number of minor steps
See also:
axisMaxMinor()
void QwtPlot::setAxisScale ( int  axisId,
double  min,
double  max,
double  stepSize = 0 
)

Disable autoscaling and specify a fixed scale for a selected axis.

In updateAxes() the scale engine calculates a scale division from the specified parameters, that will be assigned to the scale widget. So updates of the scale widget usually happen delayed with the next replot.

Parameters:
axisIdAxis index
minMinimum of the scale
maxMaximum of the scale
stepSizeMajor step size. If step == 0, the step size is calculated automatically using the maxMajor setting.
See also:
setAxisMaxMajor(), setAxisAutoScale(), axisStepSize(), QwtScaleEngine::divideScale()
void QwtPlot::setAxisScaleDiv ( int  axisId,
const QwtScaleDiv scaleDiv 
)

Disable autoscaling and specify a fixed scale for a selected axis.

The scale division will be stored locally only until the next call of updateAxes(). So updates of the scale widget usually happen delayed with the next replot.

Parameters:
axisIdAxis index
scaleDivScale division
See also:
setAxisScale(), setAxisAutoScale()
void QwtPlot::setAxisScaleDraw ( int  axisId,
QwtScaleDraw scaleDraw 
)

Set a scale draw.

Parameters:
axisIdAxis index
scaleDrawObject responsible for drawing scales.

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:
QwtScaleDraw, QwtScaleWidget
Warning:
The attributes of scaleDraw will be overwritten by those of the previous QwtScaleDraw.
void QwtPlot::setAxisScaleEngine ( int  axisId,
QwtScaleEngine scaleEngine 
)

Change the scale engine for an axis

Parameters:
axisIdAxis index
scaleEngineScale engine
See also:
axisScaleEngine()
void QwtPlot::setAxisTitle ( int  axisId,
const QString &  title 
)

Change the title of a specified axis.

Parameters:
axisIdAxis index
titleaxis title
void QwtPlot::setAxisTitle ( int  axisId,
const QwtText title 
)

Change the title of a specified axis.

Parameters:
axisIdAxis index
titleAxis title
void QwtPlot::setCanvas ( QWidget *  canvas)

Set the drawing canvas of the plot widget.

QwtPlot invokes methods of the canvas as meta methods ( see QMetaObject ). In opposite to using conventional C++ techniques like virtual methods they allow to use canvas implementations that are derived from QWidget or QGLWidget.

The following meta methods could be implemented:

  • replot() When the canvas doesn't offer a replot method, QwtPlot calls update() instead.
  • borderPath() The border path is necessary to clip the content of the canvas When the canvas doesn't have any special border ( f.e rounded corners ) it is o.k. not to implement this method.

The default canvas is a QwtPlotCanvas

Parameters:
canvasCanvas Widget
See also:
canvas()
void QwtPlot::setCanvasBackground ( const QBrush &  brush)

Change the background of the plotting area.

Sets brush to QPalette::Window of all color groups of the palette of the canvas. Using canvas()->setPalette() is a more powerful way to set these colors.

Parameters:
brushNew background brush
See also:
canvasBackground()
void QwtPlot::setFooter ( const QString &  text)

Change the text the footer

Parameters:
textNew text of the footer
void QwtPlot::setFooter ( const QwtText text)

Change the text the footer

Parameters:
textNew text of the footer

Assign a new plot layout.

Parameters:
layoutLayout()
See also:
plotLayout()
void QwtPlot::setTitle ( const QString &  title)

Change the plot's title

Parameters:
titleNew title
void QwtPlot::setTitle ( const QwtText title)

Change the plot's title

Parameters:
titleNew title
QSize QwtPlot::sizeHint ( ) const [virtual]
Returns:
Size hint for the plot widget
See also:
minimumSizeHint()
Returns:
Title of the plot
Returns:
Title label widget.
const QwtTextLabel * QwtPlot::titleLabel ( ) const
Returns:
Title label widget.
double QwtPlot::transform ( int  axisId,
double  value 
) const

Transform a value into a coordinate in the plotting region.

Parameters:
axisIdAxis index
valuevalue
Returns:
X or Y coordinate in the plotting region corresponding to the value.

Rebuild the axes scales.

In case of autoscaling the boundaries of a scale are calculated from the bounding rectangles of all plot items, having the QwtPlotItem::AutoScale flag enabled ( QwtScaleEngine::autoScale() ). Then a scale division is calculated ( QwtScaleEngine::didvideScale() ) and assigned to scale widget.

When the scale boundaries have been assigned with setAxisScale() a scale division is calculated ( QwtScaleEngine::didvideScale() ) for this interval and assigned to the scale widget.

When the scale has been set explicitly by setAxisScaleDiv() the locally stored scale division gets assigned to the scale widget.

The scale widget indicates modifications by emitting a QwtScaleWidget::scaleDivChanged() signal.

updateAxes() is usually called by replot().

See also:
setAxisAutoScale(), setAxisScale(), setAxisScaleDiv(), replot() QwtPlotItem::boundingRect()

Update the canvas margins.

Plot items might indicate, that they need some extra space at the borders of the canvas by the QwtPlotItem::Margins flag.

getCanvasMarginsHint(), QwtPlotItem::getCanvasMarginHint()

void QwtPlot::updateLayout ( ) [virtual]

Adjust plot content to its current size.

See also:
resizeEvent()
void QwtPlot::updateLegend ( const QwtPlotItem plotItem)

Emit legendDataChanged() for a plot item

Parameters:
plotItemPlot item
See also:
QwtPlotItem::legendData(), legendDataChanged()

List of all members.

 All Classes Functions Variables Typedefs Enumerations Enumerator