QwtPlot(3)

NAME
QwtPlot - A 2-D plotting widget.

SYNOPSIS

#include <qwt_plot.h>

Inherits QFrame.

  Public Types
enum { yLeft, yRight, xBottom, xTop, axisCnt }

  Public Slots
void replot ()
void updatePlot ()

  Signals
void plotMousePressed (const QMouseEvent &e)
void plotMouseReleased (const QMouseEvent &e)
void plotMouseMoved (const QMouseEvent &e)
void legendClicked (long key)

  Public Methods
QwtPlot (QWidget *p=0, const char *name=0)
QwtPlot (const char *title, QWidget *p=0, const char *name=0)
virtual ~QwtPlot ()
void enableOutline (bool tf)
void setAutoReplot (bool tf=TRUE)
void setPlotBackground (const QColor &c)
void setPlotBorder (int bw)
void setOutlineStyle (Qwt::Shape os)
void setOutlinePen (const QPen &pn)
void setTitle (const char *t)
void setTitleFont (const QFont &f)
bool autoReplot () const
bool outlineEnabled () const
const QPen & outlinePen () const
Qwt::Shape outlineStyle () const
const QColor & plotBackground () const
int plotBorder () const
QString title () const
QFont titleFont () const
void clear ()
void print (QPrinter &p, const QwtColorFilter &cfilter=NoColorFilter)
long insertCurve (const char *title, int xAxis=xBottom, int yAxis=yLeft)
bool removeCurve (long key)
void removeCurves ()
bool setCurveBaseline (long key, double ref)
bool setCurveData (long key, double *x, double *y, int size)
bool setCurveData (long key, double *x, double *y, double *e, int size)
bool setCurveOptions (long key, int t)
bool setCurvePen (long key, const QPen &pen)
bool setCurveRawData (long key, double *x, double *y, int size)
bool setCurveRawData (long key, double *x, double *y, double *e, int size)
bool setCurveSplineSize (long key, int s)
bool setCurveStyle (long key, QwtCurve::CurveStyle s, int options=0)
bool setCurveSymbol (long key, const QwtSymbol &s)
bool setCurveTitle (long key, const char *s)
bool setCurveXAxis (long key, int axis)
bool setCurveYAxis (long key, int axis)
long closestCurve (int xpos, int ypos, int &dist) const
long closestCurve (int xpos, int ypos, int &dist, double &xval, double &yval, int &index) const
double curveBaseline (long key) const
QArray< long > curveKeys () const
int curveOptions (long key) const
const QPen & curvePen (long key) const
int curveSplineSize (long key) const
QwtCurve::CurveStyle curveStyle (long key) const
const QwtSymbol & curveSymbol (long key) const
QString curveTitle (long key) const
int curveXAxis (long key) const
int curveYAxis (long key) const
void enableGridX (bool tf=TRUE)
void enableGridXMin (bool tf=TRUE)
void enableGridY (bool tf=TRUE)
void enableGridYMin (bool tf=TRUE)
void setGridXAxis (int axis)
void setGridYAxis (int axis)
void setGridPen (const QPen &p)
void setGridMajPen (const QPen &p)
void setGridMinPen (const QPen &p)
int gridXAxis () const
int gridYAxis () const
const QPen & gridMinPen ()
const QPen & gridMajPen ()
void changeAxisOptions (int axis, int opt, bool value)
void enableAxis (int axis, bool tf=TRUE)
void setAxisFont (int axis, const QFont &f)
void setAxisMargins (int axis, double mlo, double mhi)
void setAxisOptions (int axis, int opt)
void setAxisAutoScale (int axis)
void setAxisScale (int axis, double min, double max, double step=0)
void setAxisLabelFormat (int axis, char f, int prec)
void setAxisTitleFont (int axis, const QFont &f)
void setAxisMaxMinor (int axis, int maxMinor)
void setAxisMaxMajor (int axis, int maxMajor)
void setAxisReference (int axis, double value)
void setAxisTitle (int axis, const char *t)
bool axisAutoScale (int axis) const
bool axisEnabled (int axis) const
const QFont axisFont (int axis)
bool axisMargins (int axis, double &mlo, double &mhi) const
int axisMaxMajor (int axis) const
int axisMaxMinor (int axis) const
int axisOptions (int axis) const
double axisReference (int axis) const
const QwtScaleDiv & axisScale (int axis) const
void axisLabelFormat (int axis, char &f, int &prec) const
const QString & axisTitle (int axis) const
const QFont & axisTitleFont (int axis) const
double invTransform (int axis, int pos) const
int transform (int axis, double value) const
long insertMarker (const char *label=0, int xAxis=xBottom, int yAxis=yLeft)
long insertLineMarker (const char *label, int axis)
bool removeMarker (long key)
void removeMarkers ()
long closestMarker (int xpos, int ypos, int &dist) const
bool setMarkerFont (long key, const QFont &f)
bool setMarkerLinePen (long key, const QPen &p)
bool setMarkerLineStyle (long key, QwtMarker::LineStyle st)
bool setMarkerPos (long key, double xval, double yVal)
bool setMarkerSymbol (long key, const QwtSymbol &s)
bool setMarkerLabel (long key, const char *txt)
bool setMarkerLabelAlign (long key, int align)
bool setMarkerLabelPen (long key, const QPen &p)
bool setMarkerXPos (long key, double val)
bool setMarkerYPos (long key, double val)
bool setMarkerPen (long key, const QPen &p)
bool setMarkerXAxis (long key, int axis)
bool setMarkerYAxis (long key, int axis)
const QFont & markerFont (long key) const
QArray< long > markerKeys () const
const QString & markerLabel (long key) const
int markerLabelAlign (long key) const
const QPen & markerLabelPen (long key) const
const QPen & markerLinePen (long key) const
QwtMarker::LineStyle markerLineStyle (long key) const
void markerPos (long key, double &mx, double &my) const
const QwtSymbol & markerSymbol (long key) const
int markerXAxis (long key) const
int markerYAxis (long key) const
void enableLegend (bool tf)
void setLegendPos (int pos)
void setLegendFont (const QFont &f)
void setLegendFrameStyle (int st)
bool legendEnabled () const
int legendPos () const
int legendFrameStyle () const
const QFont legendFont () const

  Static Public Methods
bool axisValid (int axis)

  Protected Methods
void redrawPixmap ()
void updateAxes ()
int verifyXAxis (int axis) const
int verifyYAxis (int axis) const
void resizeEvent (QResizeEvent *e)
void autoRefresh ()

  Protected Attributes
QLabel * d_lblTitle
QwtPlotPixFrame * d_frmPlot
QwtScale * d_scale [axisCnt]
QwtLegend * d_legend
bool d_titleEnabled
QwtAutoScale d_as [axisCnt]
QwtDiMap d_map [axisCnt]
QwtScaleDiv d_sdiv [axisCnt]
QwtPlotGrid d_grid
int d_axisEnabled [axisCnt]
int d_legendEnabled
int d_legendPos
int d_plotBorder
QwtCurveDict * d_curves
QwtMarkerDict * d_markers
int d_axisDist
int d_borderDist
int d_hScaleDist
int d_vScaleDist
int d_titleDist
int d_margin
int d_autoReplot

  Friends
class QwtPlotItem
class QwtPlotPixFrame

DETAILED DESCRIPTION

A 2-D plotting widget.

 QwtPlot is a widget for plotting two-dimensional graphs. An unlimited number of data pairs can be displayed as curves in different styles and colors. A plot can have up to four axes, with each curve attached to an x- and a y axis. The scales at the axes are dimensioned automatically using an algorithm which can be configured separately for each axis. Linear and logarithmic scaling is supported. Markers of different styles can be added to the plot.

Curves and markers are identified by unique keys which are generated automatically when a curve or a marker is created. These keys are used to access the properties of the corresponding curves and markers.

A QwtPlot widget can have up to four axes which are indexed by the constants QwtPlot::yLeft, QwtPlot::yRight, QwtPlot::xTop, and QwtPlot::xBottom. Curves, markers, and the grid must be attached to an x axis and a y axis (Default: yLeft and xBottom).

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 '../include/qwt_plot.h>
QwtPlot *myPlot;
long curve1, curve2;                    // keys
double x[100], y1[100], y2[100];        // x and y values
myPlot = new QwtPlot('Two Graphs', parent, name);
// add curves
curve1 = myPlot->insertCurve('Graph 1');
curve2 = myPlot->insertCurve('Graph 2');
getSomeValues(x, y1, y2);
// copy the data into the curves
myPlot->setCurveData(curve1, x, y1, 100);
myPlot->setCurveData(curve2, x, y2, 100);
// finally, refresh the plot
myPlot->replot();

CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

  QwtPlot::QwtPlot (QWidget * p = 0, const char * name = 0)

Constructor.

  QwtPlot::QwtPlot (const char * title, QWidget * p = 0, const char * name = 0)

Constructor.

Parameters:

title
    Title text

parent
    Parent widget

name
    Widget name

  QwtPlot::~QwtPlot () [virtual]

Destructor.

MEMBER FUNCTION DOCUMENTATION

  bool QwtPlot::autoReplot () const

Returns:
TRUE if the autoReplot option is set.

  bool QwtPlot::axisAutoScale (int axis) const

Returns:
TRUE if autoscaling is enabled

Parameters:

axis
    axis index

  bool QwtPlot::axisEnabled (int axis) const

Returns:
TRUE if a specified axis is enabled

Parameters:

axis
    axis index

  const QFont QwtPlot::axisFont (int axis)

Returns:
the font of the scale labels for a specified axis

Parameters:

axis
    axis index

  void QwtPlot::axisLabelFormat (int axis, char & f, int & prec) const

Returns:
the number format for the major scale labels of a specified axis

Parameters:

axis
    axis index

Return values:

f   format character

prec
    precision

  bool QwtPlot::axisMargins (int axis, double & mlo, double & mhi) const

Determine the scale margins for a specified axis.

Parameters:

axis
    axis index

Return values:

mlo Margin at the lower limit

mhi Margin at the upper limit

See also:
QwtAutoScale::margins()

  int QwtPlot::axisMaxMajor (int axis) const

Returns:
the maximum number of major ticks for a specified axis

Parameters:

axis
    axis index

  int QwtPlot::axisMaxMinor (int axis) const

Returns:
the maximum number of minor ticks for a specified axis

Parameters:

axis
    axis index

  int QwtPlot::axisOptions (int axis) const

Returns:
the autoscaling options of a specified axis

Parameters:

axis
    axis index

See also:
QwtAutoScale::options

  double QwtPlot::axisReference (int axis) const

The reference value is needed if the autoscaling options QwtAutoScale::Symmetric or QwtAutoScale::IncludeRef are set.

Returns:
the reference value of an axis

Parameters:

axis
    axis index

See also:
QwtAutoScale, QwtPlot::setAxisOptions

  const QwtScaleDiv & QwtPlot::axisScale (int axis) const

Returns:
the scale division of a specified axis

Parameters:

axis
    axis index

See also:
QwtScaleDiv

  const QString & QwtPlot::axisTitle (int axis) const

Returns:
the title of a specified axis

Parameters:

axis
    axis index

  const QFont & QwtPlot::axisTitleFont (int axis) const

Returns:
the title font of a specified axis

Parameters:

axis
    axis index

  bool QwtPlot::axisValid (int axis) [static]

Returns:
TRUE if the specified axis exists, otherwise FALSE

Parameters:

axis
    axis index

  void QwtPlot::changeAxisOptions (int axis, int opt, bool value)

Change specified autoscaling options of an axis.

Parameters:

axis
    axis index

opt Set of or'ed options

value
    Value to be assigned to all the specified options (TRUE or FALSE)

See also:
QwtAutoScale::changeAxisOptions

  void QwtPlot::clear ()

Remove all curves and markers.

  long QwtPlot::closestCurve (int xpos, int ypos, int & dist, double & xval, double & yval, int & index) const

Find the curve which is closest to a point in the plotting area.

Determines the position and index of the closest data point.

Parameters:

xpos

ypos
    coordinates of a point in the plotting region

Return values:

xval

yvalvalues
    of the closest point in the curve's data array

dist
    -- distance in points between (xpos, ypos) and the closest data point

index
    -- index of the closest point in the curve's data array

Returns:
Key of the closest curve or 0 if no curve was found.

  long QwtPlot::closestCurve (int xpos, int ypos, int & dist) const

Find the curve which is closest to a specified point in the plotting area.

Parameters:

xpos

ypos
    position in the plotting region

Return values:

dist
    distance in points between (xpos, ypos) and the closest data point

Returns:
Key of the closest curve or 0 if no curve was found.

  long QwtPlot::closestMarker (int xpos, int ypos, int & dist) const

Find the marker which is closest to a given point.

Parameters:

xpos

ypos
    coordinates of a point in the plotting region

Return values:

dist
    Distance in points between the marker and the specified point.

Returns:
Key of the closest marker or 0 if no marker was found

  double QwtPlot::curveBaseline (long key) const

Return the baseline offset for a specified curve.

Parameters:

key curve key

Returns:
Baseline offset of the specified curve, or 0 if the curve doesn't exist

See also:
setCurveBaseline()

  QArray< long > QwtPlot::curveKeys () const

Returns:
an array containing the keys of all curves

  int QwtPlot::curveOptions (long key) const

Returns:
the drawing options of the curve indexed by key

Parameters:

key Key of the curve

  const QPen & QwtPlot::curvePen (long key) const

Returns:
the pen of the curve indexed by key

Parameters:

key Key of the curve

  int QwtPlot::curveSplineSize (long key) const

Returns:
the spline size of the curve indexed by key

Parameters:

key Key of the curve

  QwtCurve::CurveStyle QwtPlot::curveStyle (long key) const

Returns:
the style of the curve indexed by key

Parameters:

key Key of the curve

See also:
setCurveStyle()

  const QwtSymbol & QwtPlot::curveSymbol (long key) const

the symbol of the curve indexed by key.

Parameters:

key Key of the curve

Returns:
The symbol of the specified curve. If the key is invalid, a symbol of type 'NoSymbol'.

  QString QwtPlot::curveTitle (long key) const

Returns:
the title of the curve indexed by key

Parameters:

key Key of the curve

  int QwtPlot::curveXAxis (long key) const

Return the index of the x axis to which a curve is mapped.

Parameters:

key Key of the curve

Returns:
x axis of the curve or -1 if the key is invalid.

  int QwtPlot::curveYAxis (long key) const

the index of the y axis to which a curve is mapped.

Parameters:

key Key of the curve

Returns:
y axis of the curve or -1 if the key is invalid.

  void QwtPlot::enableAxis (int axis, 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:

axis
    axis index

tf  TRUE (enabled) or FALSE (disabled)

  void QwtPlot::enableGridX (bool tf = TRUE)

Enable or disable vertical gridlines.

Parameters:

tf  Enable (TRUE) or disable (FALSE). Defaults to TRUE.

  void QwtPlot::enableGridXMin (bool tf = TRUE)

Enable or disable vertical gridlines for the minor scale marks.

Parameters:

tf  enable (TRUE) or disable (FALSE). Defaults to TRUE.

  void QwtPlot::enableGridY (bool tf = TRUE)

Enable or disable horizontal gridlines.

Parameters:

tf  Enable (TRUE) or disable (FALSE). Defaults to TRUE.

  void QwtPlot::enableGridYMin (bool tf = TRUE)

Enable or disable horizontal gridlines for the minor scale marks.

Parameters:

tf  enable (TRUE) or disable (FALSE). Defaults to TRUE.

  void QwtPlot::enableLegend (bool tf)

Enable or disable the legend.

Parameters:

tf  TRUE (enabled) or FALSE (disabled)

See also:
QwtPlot::setLegendPos()

  void QwtPlot::enableOutline (bool tf)

Enables or disables outline drawing. When the outline feature is enabled, a shape will be drawn in the plotting region when the user presses or drags the mouse. It can be used to implement crosshairs, mark a selected region, etc.

Parameters:

tf  TRUE (enabled) or FALSE (disabled)

Warning:
An outline style has to be specified.

See also:
setOutlineStyle()

  long QwtPlot::insertCurve (const char * title, int xAxis = xBottom, int yAxis = yLeft)

Insert a new curve and return a unique key.

Parameters:

title
    title of the new curve

xAxis
    x axis to be attached. Defaults to xBottom.

yAxis
    y axis to be attached. Defaults to yLeft.

Returns:
The key of the new curve or 0 if no new key could be found or if no new curve could be allocated.

  long QwtPlot::insertLineMarker (const char * label, int axis)

This function is a shortcut to insert a horizontal or vertical line marker, dependent on the specified axis.

Parameters:

label
    Label

axis
    Axis to be attached

Returns:
New key if the marker could be inserted, 0 if not.

  long QwtPlot::insertMarker (const char * label = 0, int xAxis = xBottom, int yAxis = yLeft)

Insert a new marker.

Parameters:

label
    Label

xAxis
    X axis to be attached

yAxis
    Y axis to be attached

  double QwtPlot::invTransform (int axis, int pos) const

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

Parameters:

axis
    axis index

pos position

Warning:
The position can be an x or a y coordinate, depending on the specified axis.

  void QwtPlot::legendClicked (long key) [signal]

A signal which is emitted when the user has clicked on a legend item.

Parameters:

key Key of the curve corresponding to the selected legend item

  const QFont QwtPlot::legendFont () const

Returns:
the font of the legend items

  int QwtPlot::legendFrameStyle () const

Returns:
the frame style of the legend

  const QFont & QwtPlot::markerFont (long key) const

Returns:
the font of a marker

  QArray< long > QwtPlot::markerKeys () const

Returns:
an array containing the keys of all markers

  const QString & QwtPlot::markerLabel (long key) const

Returns:
a marker's label

Parameters:

key Marker key

  int QwtPlot::markerLabelAlign (long key) const

Returns:
a marker's label alignment

Parameters:

key Marker key

  const QPen & QwtPlot::markerLabelPen (long key) const

Returns:
the pen of a marker's label

Parameters:

key Marker key

  const QPen & QwtPlot::markerLinePen (long key) const

Returns:
a marker's line pen

Parameters:

key Marker key

  QwtMarker::LineStyle QwtPlot::markerLineStyle (long key) const

Returns:
a marker's line style

Parameters:

key Marker key

  void QwtPlot::markerPos (long key, double & mx, double & my) const

Get the position of a marker.

Parameters:

key Marker key

Return values:

mx

my  Marker position

  const QwtSymbol & QwtPlot::markerSymbol (long key) const

Returns:
a marker's symbol

Parameters:

key Marker key

  int QwtPlot::markerXAxis (long key) const

Returns:
the x axis to which a marker is attached

Parameters:

key Marker key

  int QwtPlot::markerYAxis (long key) const

Returns:
the y axis to which a marker is attached

Parameters:

key Marker key

  bool QwtPlot::outlineEnabled () const

Returns:
TRUE if the outline feature is enabled

  const QPen & QwtPlot::outlinePen () const

Returns:
the pen used to draw outlines

  Qwt::Shape QwtPlot::outlineStyle () const

Returns:
the outline style

See also:
setOutlineStyle()

  const QColor & QwtPlot::plotBackground () const

Returns:
the background color of the plotting area

  int QwtPlot::plotBorder () const

Returns:
the border width of the plotting area

  void QwtPlot::plotMouseMoved (const QMouseEvent & e) [signal]

A signal which is emitted when the mouse is moved in the plotting area.

Parameters:

e   Mouse event object, event coordinates referring to the plotting area

  void QwtPlot::plotMousePressed (const QMouseEvent & e) [signal]

A signal which is emitted when the mouse is pressed in the plotting area.

Parameters:

e   Mouse event object, event coordinates referring to the plotting area

  void QwtPlot::plotMouseReleased (const QMouseEvent & e) [signal]

A signal which is emitted when a mouse button has been released in the plotting area.

Parameters:

e   Mouse event object, event coordinates referring to the plotting area

  void QwtPlot::print (QPrinter & pr, const QwtColorFilter & cfilter = NoColorFilter)

Print the plot to a QPrinter This function prints the contents of a QwtPlot instance to QPrinter object. The printed output is independent of the widget displayed on the screen.

Parameters:

prThe
    printer

cfilter
    color filter for curves and markers

Warning:

The background of the plot is not printed.

Scales and titles are always printed in black color.

major gridlines are printed in dark gray; minor gridlines are printed in gray.

Curves, markers, symbols, etc. are printed in their screen colors if no color filter is specified. A color filter may be useful if curves have bright colors (which would be hardly visible), or if a grayscale output is desired.

Font sizes and line widths are not scaled.

The size of the printed plot is determined automatically, dependent on the page size.

Example

myPlot->print(printer);                  // screen colors
myPlot->print(printer, QwtFltrDim(200)); // colors darkened
myPlot->print(printer, QwtFltrInv());    // colors inverted

 \bugs

The legend is not printed.

QPrinter has some bugs in Qt 1.2 (see Qt manual on QPrinter).

See also:
QwtColorFilter

  bool QwtPlot::removeCurve (long key)

remove the curve indexed by key.

Parameters:

key Key of the curve

  void QwtPlot::removeCurves ()

Remove all curves.

  bool QwtPlot::removeMarker (long key)

Remove the marker indexed by key.

Parameters:

key unique key

  void QwtPlot::removeMarkers ()

Remove all markers.

  void QwtPlot::replot () [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:
setAutoReplot()

  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:

tf  TRUE or FALSE. Defaults to TRUE.

See also:
replot()

  void QwtPlot::setAxisAutoScale (int axis)

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:

axis
    axis index

See also:
setAxisScale()

  void QwtPlot::setAxisFont (int axis, const QFont & f)

Change the font of an axis.

Parameters:

axis
    axis index

f   font

Warning:
This function changes the font of the tick labels, not of the axis title.

  void QwtPlot::setAxisLabelFormat (int axis, char f, int prec)

Change the number format for the major scale of a selected axis.

Parameters:

axis
    axis index

f   format

prec
    precision

  void QwtPlot::setAxisMargins (int axis, double mlo, double mhi)

Assign margins to a specified axis.

Parameters:

axis
    axis index

mlo margin at the lower end of the scale

mhi margin at the upper end of the scale

Warning:
If the scale is logarithmic, the margins are measured in decades

See also:
QwtAutoScale::setMargins

  void QwtPlot::setAxisMaxMajor (int axis, int maxMajor)

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

Parameters:

axis
    axis index

maxMajor
    maximum number of major steps

See also:
QwtAutoScale::setMaxMajor

  void QwtPlot::setAxisMaxMinor (int axis, int maxMinor)

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

Parameters:

axis
    axis index

maxMinor
    maximum number of minor steps

See also:
QwtAutoScale::setMaxMinor

  void QwtPlot::setAxisOptions (int axis, int opt)

Reset scale options and set specified options for a specified axis.

Parameters:

axis
    axis index

opt set of options

See also:
QwtAutoScale::setOptions

  void QwtPlot::setAxisReference (int axis, double value)

Set a reference value for a specified axis.

 The reference value is used by some autoscaling modes.

Parameters:

axis
    axis index

value
    reference value

See also:
QwtAutoScale::setReference, setAxisOptions()

  void QwtPlot::setAxisScale (int axis, double min, double max, double step = 0)

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

Parameters:

axis
    axis index

min

max minimum and maximum of the scale

step
    Major step size. If step == 0, the step size is calculated automatically using the maxMajor setting.

See also:
setAxisMaxMajor()

  void QwtPlot::setAxisTitle (int axis, const char * t)

Change the title of a specified axis.

Parameters:

axis
    axis index

t   axis title

  void QwtPlot::setAxisTitleFont (int axis, const QFont & f)

Change the title font of a selected axis.

Parameters:

axis
    axis index

f   font

  bool QwtPlot::setCurveBaseline (long key, double ref)

Set the baseline for a specified curve.

 The baseline is needed for the curve style QwtCurve::Sticks,

Parameters:

key curve key

ref baseline offset from zero

See also:
QwtCurve::setBaseline

  bool QwtPlot::setCurveData (long key, double * xdat, double * ydat, int size)

Assign x and y values to a curve. In opposite to @QwtPlot::setCurveRawData@, this function makes a 'deep copy' of the data.

Parameters:

key curve key

xdat
    pointer to x values

ydat
    pointer to y values

size
    size of xdat and ydat

See also:
setCurveRawData(), QwtCurve::setData

  bool QwtPlot::setCurveOptions (long key, int opt)

Set the style options of a curve indexed by key.

Parameters:

key The curve's key

opt The type of the spline

Returns:
TRUE if the specified curve exists.

See also:
QwtCurve::setOptions for a detailed description of valid options.

  bool QwtPlot::setCurvePen (long key, const QPen & pen)

Assign a pen to a curve indexed by key.

Parameters:

key Key of the curve

pen new pen

Returns:
TRUE if the curve exists

  bool QwtPlot::setCurveRawData (long key, double * xdat, double * ydat, double * edat, int size)

  bool QwtPlot::setCurveRawData (long key, double * xdat, double * ydat, int size)

Attach a curve to the specified arrays without copying.

 This function does not copy the values of the specified arrays. Removing the curve will not delete the data.

Parameters:

key Key of the curve

xdat

ydat
    Pointers to x and y data

size
    size of ydat and ydat

Returns:
TRUE if the curve exists

Warning:
Don't delete dynamically allocated data while a curve is attached to them.

See also:
setCurveData(), QwtCurve::setRawData

  bool QwtPlot::setCurveSplineSize (long key, int s)

Set the number of interpolated points of a curve indexed by key.

Parameters:

key key of the curve

s   size of the spline

Returns:
TRUE if the curve exists

  bool QwtPlot::setCurveStyle (long key, QwtCurve::CurveStyle s, int options = 0)

Change a curve's style.

Parameters:

key Key of the curve

s   display style of the curve

options
    style options

Returns:
TRUE if the curve exists

See also:
QwtCurve::setStyle() for a detailed description of valid styles.

  bool QwtPlot::setCurveSymbol (long key, const QwtSymbol & s)

Assign a symbol to a curve indexed by key.

Parameters:

key Key of the curve

s   Returns:
    TRUE if the curve exists

  bool QwtPlot::setCurveTitle (long key, const char * s)

Parameters:

key

s

  bool QwtPlot::setCurveXAxis (long key, int axis)

Attach a curve to an x axis.

Parameters:

key key of the curve

axis
    x axis to be attached

  bool QwtPlot::setCurveYAxis (long key, int axis)

Attach a curve to an y axis.

Parameters:

key key of the curve

axis
    y axis to be attached

  void QwtPlot::setGridMajPen (const QPen & p)

Change the pen for the major gridlines.

Parameters:

p   new pen

  void QwtPlot::setGridMinPen (const QPen & p)

Change the pen for the minor gridlines.

Parameters:

p   new pen

  void QwtPlot::setGridPen (const QPen & p)

Change the grid's pens for major and minor gridlines.

Parameters:

p   new pen

  void QwtPlot::setGridXAxis (int axis)

Attach the grid to an x axis.

Parameters:

axis
    x axis to be attached

  void QwtPlot::setGridYAxis (int axis)

Attach the grid to an y axis.

Parameters:

axis
    y axis to be attached

  void QwtPlot::setLegendFont (const QFont & f)

Change the font of the legend items.

Parameters:

fnew
    font

  void QwtPlot::setLegendFrameStyle (int st)

Change the legend's frame style.

Parameters:

stFrame
    Style. See Qt manual on QFrame.

  void QwtPlot::setLegendPos (int pos)

Specify the position of the legend within the widget.

Parameters:

pos The legend's position. Valid values are Qwt::Left, Qwt::Right, Qwt::Top, QwtBottom.

  bool QwtPlot::setMarkerFont (long key, const QFont & f)

Specify a font for a marker's label.

Parameters:

key Marker key

f   New font

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerLabel (long key, const char * txt)

Assign a label to a marker.

Parameters:

key Marker key

txt Label text

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerLabelAlign (long key, int align)

Specify the alignment of a marker's label.

 The alignment determines the position of the label relative to the marker's position. The default setting is AlignCenter.

Parameters:

key Marker key

align
    Alignment: AlignLeft, AlignRight, AlignTop, AlignBottom, AlignHCenter, AlignVCenter, AlignCenter or a combination of them.

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerLabelPen (long key, const QPen & p)

Specify a pen for a marker's label.

Parameters:

key Marker key

p   Label pen

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerLinePen (long key, const QPen & p)

Specify a pen for a marker's line.

Parameters:

key Marker key

p   New pen

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerLineStyle (long key, QwtMarker::LineStyle st)

Specify the line style for a marker.

Parameters:

key Marker key

st  Line style: QwtMarker::HLine, QwtMarker::VLine, QwtMarker::NoLine or a combination of them.

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerPen (long key, const QPen & p)

Specify a pen for a marker's label.

Parameters:

key Marker key

p   New pen

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerPos (long key, double xval, double yval)

Change the position of a marker.

Parameters:

key Marker key

xval

yval
    Position of the marker in axis coordinates.

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerSymbol (long key, const QwtSymbol & s)

Assign a symbol to a specified marker.

Parameters:

key Marker key

s   new symbol

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerXAxis (long key, int axis)

Attach the marker to an x axis.

Returns:
TRUE if the specified marker exists.

  bool QwtPlot::setMarkerXPos (long key, double val)

Specify the X position of a marker.

Parameters:

key Marker key

val X position of the marker

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerYAxis (long key, int axis)

Attach the marker to a Y axis.

Parameters:

key Marker key

axis
    Axis to be attached

Returns:
TRUE if the specified marker exists

  bool QwtPlot::setMarkerYPos (long key, double val)

Specify the Y position of the marker.

Parameters:

key Marker key

val Y position of the marker

Returns:
TRUE if the specified marker exists

  void QwtPlot::setOutlinePen (const QPen & pn)

Specify a pen for the outline.

Parameters:

pn  new pen

  void QwtPlot::setOutlineStyle (Qwt::Shape os)

Specify the style of the outline.

 The outline style determines which kind of shape is drawn in the plotting region when the user presses a mouse button or drags the mouse. Valid Styles are:

Parameters:

os  Outline Style. Valid values are: Qwt::HLine, Qwt::VLine, Qwt::Cross, Qwt::Rect, Qwt::Ellipse

Qwt::Cros
    Cross hairs are drawn across the plotting area when the user presses a mouse button. The lines intersect at the point where the mouse was pressed and move with the mouse pointer.

Qwt::HLine, Qwt::VLine
    A horizontal or vertical line appears when the user presses a mouse button. This is useful for moving line markers.

Qwt::Rect
    A rectangle is displayed when the user drags the mouse. One corner is fixed at the point where the mouse was pressed, and the opposite corner moves with the mouse pointer. This can be used for selecting regions.

Qwt::Ellipse
    Similar to Qwt::Rect, but with an ellipse inside a bounding rectangle.

See also:
enableOutline()

  void QwtPlot::setPlotBackground (const QColor & c)

Change the background of the plotting area.

Parameters:

c   new background color

  void QwtPlot::setPlotBorder (int w)

Change the border width of the plotting area.

Parameters:

w   new border width

  void QwtPlot::setTitle (const char * t)

Change the plot's title.

Parameters:

t   new title

  void QwtPlot::setTitleFont (const QFont & f)

Change the title font.

Parameters:

f   new title font

  QString QwtPlot::title () const

Returns:
the plot's title

  QFont QwtPlot::titleFont () const

Returns:
the plot's title font

  int QwtPlot::transform (int axis, double value) const

Transform a value into a coordinate in the plotting region.

Parameters:

axis
    axis index

value
    value

Returns:
X or y coordinate in the plotting region corresponding to the value.

  void QwtPlot::updateAxes () [protected]

Rebuild the scales and maps.

  int QwtPlot::verifyXAxis (int axis) const [protected]

Check if an index is a valid x axis.

Parameters:

axis
    axis index

Returns:
its input value if the specified axis is an x axis; the default x axis if not.

  int QwtPlot::verifyYAxis (int axis) const [protected]

Checks if an integer is a valid index for a y axis.

Parameters:

axis
    axis index

Returns:
its input value if the specified axis is an x axis; the default x axis if not.

AUTHOR

Generated automatically by Doxygen for Qwt User's Guide from the source code.