📄 qwtplot.3
字号:
.TH "QwtPlot" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtPlot \- .SH SYNOPSIS.br.PP.SH "Detailed Description".PP 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..PPCurves and markers are identified by unique keys which are generated automatically when a curve or a marker is inserted. These keys are used to access the properties of the corresponding curves and markers..PPA 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)..PP\fBExample\fP.RS 4The 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. .PP.nf#include "../include/qwt_plot.h>QwtPlot *myPlot;long curve1, curve2; // keysdouble x[100], y1[100], y2[100]; // x and y valuesmyPlot = new QwtPlot("Two Graphs", parent, name);// add curvescurve1 = myPlot->insertCurve("Graph 1");curve2 = myPlot->insertCurve("Graph 2");getSomeValues(x, y1, y2);// copy the data into the curvesmyPlot->setCurveData(curve1, x, y1, 100);myPlot->setCurveData(curve2, x, y2, 100);// finally, refresh the plotmyPlot->replot();.PP.RE.PP.PP.SS "Public Types".in +1c.ti -1c.RI "enum \fBAxis\fP { \fByLeft\fP, \fByRight\fP, \fBxBottom\fP, \fBxTop\fP, \fBaxisCnt\fP }".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtPlot\fP (QWidget *p=0, const char *name=0)".br.ti -1c.RI "\fBQwtPlot\fP (const QString &title, QWidget *p=0, const char *name=0)".br.ti -1c.RI "virtual \fB~QwtPlot\fP ()".br.ti -1c.RI "void \fBenableXBottomAxis\fP (bool b)".br.ti -1c.RI "bool \fBxBottomAxisEnabled\fP () const ".br.ti -1c.RI "void \fBenableXTopAxis\fP (bool b)".br.ti -1c.RI "bool \fBxTopAxisEnabled\fP () const ".br.ti -1c.RI "void \fBenableYRightAxis\fP (bool b)".br.ti -1c.RI "bool \fByRightAxisEnabled\fP () const ".br.ti -1c.RI "void \fBenableYLeftAxis\fP (bool b)".br.ti -1c.RI "bool \fByLeftAxisEnabled\fP () const ".br.ti -1c.RI "void \fBsetAutoReplot\fP (bool tf=TRUE)".br.ti -1c.RI "bool \fBautoReplot\fP () const ".br.ti -1c.RI "void \fBprint\fP (QPaintDevice &p, const \fBQwtPlotPrintFilter\fP &=\fBQwtPlotPrintFilter\fP()) const ".br.ti -1c.RI "virtual void \fBprint\fP (QPainter *, const QRect &rect, const \fBQwtPlotPrintFilter\fP &=\fBQwtPlotPrintFilter\fP()) const ".br.ti -1c.RI "void \fBclear\fP ()".br.ti -1c.RI "void \fBenableOutline\fP (bool tf)".br.ti -1c.RI "bool \fBoutlineEnabled\fP () const ".br.ti -1c.RI "void \fBsetOutlineStyle\fP (Qwt::Shape os)".br.ti -1c.RI "Qwt::Shape \fBoutlineStyle\fP () const ".br.ti -1c.RI "void \fBsetOutlinePen\fP (const QPen &pn)".br.ti -1c.RI "const QPen & \fBoutlinePen\fP () const ".br.ti -1c.RI "\fBQwtPlotLayout\fP * \fBplotLayout\fP ()".br.ti -1c.RI "const \fBQwtPlotLayout\fP * \fBplotLayout\fP () const ".br.ti -1c.RI "void \fBsetMargin\fP (int margin)".br.ti -1c.RI "int \fBmargin\fP () const ".br.ti -1c.RI "void \fBsetTitle\fP (const QString &t)".br.ti -1c.RI "QString \fBtitle\fP () const ".br.ti -1c.RI "void \fBsetTitleFont\fP (const QFont &f)".br.ti -1c.RI "QFont \fBtitleFont\fP () const ".br.ti -1c.RI "QLabel * \fBtitleLabel\fP ()".br.ti -1c.RI "const QLabel * \fBtitleLabel\fP () const ".br.ti -1c.RI "\fBQwtPlotCanvas\fP * \fBcanvas\fP ()".br.ti -1c.RI "const \fBQwtPlotCanvas\fP * \fBcanvas\fP () const ".br.ti -1c.RI "void \fBsetCanvasBackground\fP (const QColor &c)".br.ti -1c.RI "const QColor & \fBcanvasBackground\fP () const ".br.ti -1c.RI "void \fBsetCanvasLineWidth\fP (int w)".br.ti -1c.RI "int \fBcanvasLineWidth\fP () const ".br.ti -1c.RI "QwtPlotCurveIterator \fBcurveIterator\fP () const ".br.ti -1c.RI "QwtPlotMarkerIterator \fBmarkerIterator\fP () const ".br.ti -1c.RI "\fBQwtDiMap\fP \fBcanvasMap\fP (int axis) const ".br.ti -1c.RI "double \fBinvTransform\fP (int axis, int pos) const ".br.ti -1c.RI "int \fBtransform\fP (int axis, double value) const ".br.ti -1c.RI "long \fBinsertCurve\fP (\fBQwtPlotCurve\fP *)".br.ti -1c.RI "long \fBinsertCurve\fP (const QString &title, int xAxis=xBottom, int yAxis=yLeft)".br.ti -1c.RI "\fBQwtPlotCurve\fP * \fBcurve\fP (long key)".br.ti -1c.RI "const \fBQwtPlotCurve\fP * \fBcurve\fP (long key) const ".br.ti -1c.RI "bool \fBremoveCurve\fP (long key)".br.ti -1c.RI "void \fBremoveCurves\fP ()".br.ti -1c.RI "QwtArray< long > \fBcurveKeys\fP () const ".br.ti -1c.RI "long \fBclosestCurve\fP (int xpos, int ypos, int &dist) const ".br.ti -1c.RI "long \fBclosestCurve\fP (int xpos, int ypos, int &dist, double &xval, double &yval, int &index) const ".br.ti -1c.RI "bool \fBsetCurveBaseline\fP (long key, double ref)".br.ti -1c.RI "double \fBcurveBaseline\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveRawData\fP (long key, const double *x, const double *y, int size)".br.ti -1c.RI "bool \fBsetCurveData\fP (long key, const double *x, const double *y, int size)".br.ti -1c.RI "bool \fBsetCurveData\fP (long key, const QwtArray< double > &x, const QwtArray< double > &y)".br.ti -1c.RI "bool \fBsetCurveData\fP (long key, const QwtArray< \fBQwtDoublePoint\fP > &data)".br.ti -1c.RI "bool \fBsetCurveData\fP (long key, const \fBQwtData\fP &data)".br.ti -1c.RI "bool \fBsetCurveOptions\fP (long key, int t)".br.ti -1c.RI "int \fBcurveOptions\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurvePen\fP (long key, const QPen &pen)".br.ti -1c.RI "QPen \fBcurvePen\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveBrush\fP (long key, const QBrush &brush)".br.ti -1c.RI "QBrush \fBcurveBrush\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveSplineSize\fP (long key, int s)".br.ti -1c.RI "int \fBcurveSplineSize\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveStyle\fP (long key, int s, int options=0)".br.ti -1c.RI "int \fBcurveStyle\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveSymbol\fP (long key, const \fBQwtSymbol\fP &s)".br.ti -1c.RI "\fBQwtSymbol\fP \fBcurveSymbol\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveTitle\fP (long key, const QString &s)".br.ti -1c.RI "QString \fBcurveTitle\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveXAxis\fP (long key, int axis)".br.ti -1c.RI "int \fBcurveXAxis\fP (long key) const ".br.ti -1c.RI "bool \fBsetCurveYAxis\fP (long key, int axis)".br.ti -1c.RI "int \fBcurveYAxis\fP (long key) const ".br.ti -1c.RI "void \fBdrawCurve\fP (long key, int from=0, int to=-1)".br.ti -1c.RI "void \fBenableGridX\fP (bool tf=TRUE)".br.ti -1c.RI "void \fBenableGridXMin\fP (bool tf=TRUE)".br.ti -1c.RI "void \fBenableGridY\fP (bool tf=TRUE)".br.ti -1c.RI "void \fBenableGridYMin\fP (bool tf=TRUE)".br.ti -1c.RI "void \fBsetGridXAxis\fP (int axis)".br.ti -1c.RI "int \fBgridXAxis\fP () const ".br.ti -1c.RI "void \fBsetGridYAxis\fP (int axis)".br.ti -1c.RI "int \fBgridYAxis\fP () const ".br.ti -1c.RI "void \fBsetGridPen\fP (const QPen &p)".br.ti -1c.RI "void \fBsetGridMajPen\fP (const QPen &p)".br.ti -1c.RI "const QPen & \fBgridMajPen\fP () const ".br.ti -1c.RI "void \fBsetGridMinPen\fP (const QPen &p)".br.ti -1c.RI "const QPen & \fBgridMinPen\fP () const ".br.ti -1c.RI "\fBQwtPlotGrid\fP & \fBgrid\fP ()".br.ti -1c.RI "const \fBQwtPlotGrid\fP & \fBgrid\fP () const ".br.ti -1c.RI "void \fBsetAxisAutoScale\fP (int axis)".br.ti -1c.RI "bool \fBaxisAutoScale\fP (int axis) const ".br.ti -1c.RI "void \fBenableAxis\fP (int axis, bool tf=TRUE)".br.ti -1c.RI "bool \fBaxisEnabled\fP (int axis) const ".br.ti -1c.RI "void \fBchangeAxisOptions\fP (int axis, int opt, bool value)".br.ti -1c.RI "void \fBsetAxisOptions\fP (int axis, int opt)".br.ti -1c.RI "int \fBaxisOptions\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisFont\fP (int axis, const QFont &f)".br.ti -1c.RI "QFont \fBaxisFont\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisMargins\fP (int axis, double mlo, double mhi)".br.ti -1c.RI "bool \fBaxisMargins\fP (int axis, double &mlo, double &mhi) const ".br.ti -1c.RI "void \fBsetAxisScale\fP (int axis, double min, double max, double step=0)".br.ti -1c.RI "void \fBsetAxisScaleDraw\fP (int axis, \fBQwtScaleDraw\fP *)".br.ti -1c.RI "const \fBQwtScaleDiv\fP * \fBaxisScale\fP (int axis) const ".br.ti -1c.RI "const \fBQwtScaleDraw\fP * \fBaxisScaleDraw\fP (int axis) const ".br.ti -1c.RI "const \fBQwtScale\fP * \fBaxis\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisLabelFormat\fP (int axis, char f, int prec, int fieldwidth=0)".br.ti -1c.RI "void \fBaxisLabelFormat\fP (int axis, char &f, int &prec, int &fieldwidth) const ".br.ti -1c.RI "void \fBsetAxisLabelAlignment\fP (int axis, int alignment)".br.ti -1c.RI "void \fBsetAxisLabelRotation\fP (int axis, double rotation)".br.ti -1c.RI "void \fBsetAxisTitle\fP (int axis, const QString &t)".br.ti -1c.RI "QString \fBaxisTitle\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisTitleFont\fP (int axis, const QFont &f)".br.ti -1c.RI "QFont \fBaxisTitleFont\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisTitleAlignment\fP (int axis, int align)".br.ti -1c.RI "int \fBaxisTitleAlignment\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisMaxMinor\fP (int axis, int maxMinor)".br.ti -1c.RI "int \fBaxisMaxMajor\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisMaxMajor\fP (int axis, int maxMajor)".br.ti -1c.RI "int \fBaxisMaxMinor\fP (int axis) const ".br.ti -1c.RI "void \fBsetAxisReference\fP (int axis, double value)".br.ti -1c.RI "double \fBaxisReference\fP (int axis) const ".br.ti -1c.RI "long \fBinsertMarker\fP (\fBQwtPlotMarker\fP *)".br.ti -1c.RI "long \fBinsertMarker\fP (const QString &label=QString::null, int xAxis=xBottom, int yAxis=yLeft)".br.ti -1c.RI "long \fBinsertLineMarker\fP (const QString &label, int axis)".br.ti -1c.RI "\fBQwtPlotMarker\fP * \fBmarker\fP (long key)".br.ti -1c.RI "const \fBQwtPlotMarker\fP * \fBmarker\fP (long key) const ".br.ti -1c.RI "bool \fBremoveMarker\fP (long key)".br.ti -1c.RI "void \fBremoveMarkers\fP ()".br.ti -1c.RI "long \fBclosestMarker\fP (int xpos, int ypos, int &dist) const ".br.ti -1c.RI "QwtArray< long > \fBmarkerKeys\fP () const ".br.ti -1c.RI "bool \fBsetMarkerXAxis\fP (long key, int axis)".br.ti -1c.RI "int \fBmarkerXAxis\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerYAxis\fP (long key, int axis)".br.ti -1c.RI "int \fBmarkerYAxis\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerPos\fP (long key, double xval, double yVal)".br.ti -1c.RI "bool \fBsetMarkerXPos\fP (long key, double val)".br.ti -1c.RI "bool \fBsetMarkerYPos\fP (long key, double val)".br.ti -1c.RI "void \fBmarkerPos\fP (long key, double &mx, double &my) const ".br.ti -1c.RI "bool \fBsetMarkerFont\fP (long key, const QFont &f)".br.ti -1c.RI "QFont \fBmarkerFont\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerPen\fP (long key, const QPen &p)".br.ti -1c.RI "bool \fBsetMarkerLabel\fP (long key, const QString &text, const QFont &font=QFont(), const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))".br.ti -1c.RI "bool \fBsetMarkerLabelText\fP (long key, const QString &text)".br.ti -1c.RI "const QString \fBmarkerLabel\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerLabelAlign\fP (long key, int align)".br.ti -1c.RI "int \fBmarkerLabelAlign\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerLabelPen\fP (long key, const QPen &p)".br.ti -1c.RI "QPen \fBmarkerLabelPen\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerLinePen\fP (long key, const QPen &p)".br.ti -1c.RI "QPen \fBmarkerLinePen\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerLineStyle\fP (long key, \fBQwtMarker::LineStyle\fP st)".br.ti -1c.RI "\fBQwtMarker::LineStyle\fP \fBmarkerLineStyle\fP (long key) const ".br.ti -1c.RI "bool \fBsetMarkerSymbol\fP (long key, const \fBQwtSymbol\fP &s)".br.ti -1c.RI "\fBQwtSymbol\fP \fBmarkerSymbol\fP (long key) const ".br.ti -1c.RI "void \fBsetAutoLegend\fP (bool enabled)".br.ti -1c.RI "bool \fBautoLegend\fP () const ".br.ti -1c.RI "void \fBenableLegend\fP (bool tf, long curveKey=-1)".br.ti -1c.RI "bool \fBlegendEnabled\fP (long curveKey) const ".br.ti -1c.RI "void \fBsetLegendPos\fP (int pos, double ratio=0.0)".br.ti -1c.RI "int \fBlegendPos\fP () const ".br.ti -1c.RI "void \fBsetLegendFont\fP (const QFont &f)".br.ti -1c.RI "const QFont \fBlegendFont\fP () const ".br.ti -1c.RI "void \fBsetLegendFrameStyle\fP (int st)".br.ti -1c.RI "int \fBlegendFrameStyle\fP () const ".br.ti -1c.RI "\fBQwtLegend\fP * \fBlegend\fP ()".br.ti -1c.RI "const \fBQwtLegend\fP * \fBlegend\fP () const ".br.ti -1c.RI "void \fBsetLegendDisplayPolicy\fP (\fBQwtLegend::LegendDisplayPolicy\fP, int mode=-1)".br.ti -1c.RI "virtual QSize \fBsizeHint\fP () const ".br.ti -1c.RI "virtual QSize \fBminimumSizeHint\fP () const ".br.ti -1c.RI "virtual QSizePolicy \fBsizePolicy\fP () const ".br.ti -1c.RI "virtual bool \fBevent\fP (QEvent *)".br.ti -1c.RI "virtual void \fBreplot\fP ()".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "virtual void \fBlgdClicked\fP ()".br.ti -1c.RI "void \fBplotMousePressed\fP (const QMouseEvent &e)".br.ti -1c.RI "void \fBplotMouseReleased\fP (const QMouseEvent &e)".br.ti -1c.RI "void \fBplotMouseMoved\fP (const QMouseEvent &e)".br.ti -1c.RI "void \fBlegendClicked\fP (long key)".br.ti -1c.RI "void \fBautoRefresh\fP ()".br.ti -1c.RI "virtual void \fBdrawCanvas\fP (QPainter *)".br.ti -1c.RI "virtual void \fBdrawCanvasItems\fP (QPainter *, const QRect &, const QwtArray< \fBQwtDiMap\fP > &, const \fBQwtPlotPrintFilter\fP &) const ".br
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -