|
|
| QwtPyPlot (QwtFigure *figure, QObject *parent=nullptr) |
| |
|
| QwtPyPlot (QwtPlot *plot, QObject *parent=nullptr) |
| |
|
QwtFigure * | gcf () const |
| |
|
QwtPlot * | gca () const |
| |
|
void | sca (QwtPlot *plot) |
| |
| QwtPlot * | subplot (int rows, int cols, int index) |
| | Create a subplot in a grid layout
|
| |
|
QwtPlot * | addAxes (const QRectF &rect=QRectF(0.1, 0.1, 0.8, 0.8)) |
| |
|
QwtPlot * | twinx (QwtPlot *host=nullptr) |
| |
|
QwtPlot * | twiny (QwtPlot *host=nullptr) |
| |
|
void | tightLayout () |
| |
|
QwtPlotCurve * | plot (const QVector< double > &y, const QString &fmt=QString(), const QString &label=QString()) |
| |
|
QwtPlotCurve * | plot (const QVector< double > &x, const QVector< double > &y, const QString &fmt=QString(), const QString &label=QString()) |
| |
|
QwtPlotCurve * | plot (const QVector< QPointF > &data, const QString &fmt=QString(), const QString &label=QString()) |
| |
| QwtPlotCurve * | scatter (const QVector< double > &x, const QVector< double > &y, double size=20, const QString &color=QString(), const QString &label=QString()) |
| | Create a scatter plot (markers only, no lines)
|
| |
|
QwtPlotBarChart * | bar (const QVector< double > &values, const QString &color=QString(), const QString &label=QString()) |
| |
|
QwtPlotBarChart * | bar (const QVector< double > &x, const QVector< double > &values, double width=0.8, const QString &color=QString(), const QString &label=QString()) |
| |
| QwtPlotHistogram * | hist (const QVector< double > &data, int bins=10, const QString &color=QString(), const QString &label=QString()) |
| | Create a histogram from raw data with automatic binning
|
| |
|
QwtPlotBoxChart * | boxplot (const QVector< QwtBoxSample > &data, const QString &label=QString()) |
| |
| QwtPlotIntervalCurve * | fillBetween (const QVector< double > &x, const QVector< double > &y1, const QVector< double > &y2, const QString &color=QString(), double alpha=0.3) |
| | Fill the area between two curves
|
| |
| QwtPlotIntervalCurve * | errorbar (const QVector< double > &x, const QVector< double > &y, const QVector< double > &yerr, const QString &fmt=QString(), const QString &label=QString()) |
| | Create error bars with symmetric y-error
|
| |
| QwtPlotSpectrogram * | imshow (const QVector< QVector< double > > &data, const QString &cmap="viridis", double vmin=0.0, double vmax=0.0) |
| | Display a 2D matrix as a color-mapped image
|
| |
| QwtPlotSpectrogram * | contour (const QVector< QVector< double > > &data, const QList< double > &levels={}, const QString &cmap="viridis") |
| | Draw contour lines from a 2D matrix
|
| |
| QwtPlotVectorField * | quiver (const QVector< double > &x, const QVector< double > &y, const QVector< double > &u, const QVector< double > &v, const QString &color=QString()) |
| | Create a quiver (vector field) plot
|
| |
|
QwtPlotTradingCurve * | candlestick (const QVector< QwtOHLCSample > &data, const QString &label=QString()) |
| |
|
QwtPlotGrid * | grid (bool show=true, bool minor=false) |
| |
|
QwtPlotMarker * | axhline (double y, const QString &fmt=QString()) |
| |
|
QwtPlotMarker * | axvline (double x, const QString &fmt=QString()) |
| |
|
QwtPlotZoneItem * | axhspan (double y1, double y2, const QString &color=QString(), double alpha=0.3) |
| |
|
QwtPlotZoneItem * | axvspan (double x1, double x2, const QString &color=QString(), double alpha=0.3) |
| |
|
QwtPlotArrowMarker * | annotate (const QString &text, const QPointF &xy, const QPointF &xytext) |
| |
|
QwtPlotLegendItem * | legend (const QString &loc="best") |
| |
|
void | setTitle (const QString &title) |
| |
|
void | setXLabel (const QString &label) |
| |
|
void | setYLabel (const QString &label) |
| |
|
void | setXLim (double min, double max) |
| |
|
void | setYLim (double min, double max) |
| |
|
void | setXScale (const QString &scale) |
| |
|
void | setYScale (const QString &scale) |
| |
|
void | setXTicks (const QVector< double > &ticks, const QStringList &labels={}) |
| |
|
void | setYTicks (const QVector< double > &ticks, const QStringList &labels={}) |
| |
|
void | invertXAxis () |
| |
|
void | invertYAxis () |
| |
|
void | setFaceColor (const QString &color) |
| |
|
void | setAxesColor (const QString &color) |
| |
|
void | colorbar (QwtPlotSpectrogram *spectro=nullptr) |
| |
|
bool | savefig (const QString &filename, int dpi=-1) |
| |
|
void | show () |
| |
|
void | enablePan (bool enable=true) |
| |
|
void | enableZoom (bool enable=true) |
| |
Matplotlib pyplot-like interface for Qwt plotting
QwtPyPlot provides a high-level, stateful API inspired by matplotlib's pyplot module. It wraps a QwtFigure (or a single QwtPlot) and delegates all operations to the existing Qwt infrastructure (QwtPlotFactory, QwtPlotStyling, etc.).
The class maintains a "current axes" pointer (like matplotlib's gca()), so successive calls to plot(), setTitle(), etc. always operate on the active subplot.
- Example:
plt.subplot(2, 1, 1);
plt.plot({0, 1, 2, 3}, {1, 4, 2, 5}, "r-o", "Temperature");
plt.setTitle("Sensor Data");
plt.grid(true);
plt.legend();
plt.subplot(2, 1, 2);
plt.bar({10, 20, 30, 40}, "b", "Sales");
plt.savefig("output.png", 300);
fig->show();
Matplotlib pyplot-like interface for Qwt plotting
Definition qwt_pyplot.h:113
- Single-plot mode:
plt.plot(x, y, "b--");
plt.scatter(x2, y2, 50, "r");
plot->show();
A 2-D plotting widget
Definition qwt_plot.h:99
- 参见
- QwtFigure, QwtPlot, QwtPlotFactory, QwtPlotStyling