#include "qwt_plot.h"
#include "qwt_plot_curve.h"
#include <QApplication>
int main( int argc, char* argv[] )
{
for (float t = 0.0; t < 10.0; t+=0.1f)
curve->setPen(color, 16);
curve->setSamples(points);
curve->attach(&plot);
plot.show();
return app.exec();
}
#include "qwt_plot.h"
#include "qwt_plot_curve.h"
#include <QApplication>
int main( int argc, char* argv[] )
{
QApplication app( argc, argv );
QwtPlot plot;
QPolygonF points;
for (float t = 0.0; t < 10.0; t+=0.1f)
points << QPointF(t,std::sin(t));
QwtPlotCurve *curve = new QwtPlotCurve();
QColor color(255,0,0,128);
curve->setPen(color, 16);
curve->setSamples(points);
curve->attach(&plot);
plot.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
#include "qwt_plot.h"
#include "qwt_plot_curve.h"
#include <QApplication>
{
color.setAlphaF(alpha);
curve->setPen(color,width);
curve->setSamples(points);
curve->attach(plot);
}
int main( int argc, char* argv[] )
{
for (float t = 0.0; t < 10.0; t+=0.1f)
addCurve(&plot, points, Qt::green, 16, 0.05);
addCurve(&plot, points, Qt::green, 10, 0.1);
addCurve(&plot, points, Qt::green, 6, 0.15);
addCurve(&plot, points, Qt::white, 2, 0.25);
plot.show();
return app.exec();
}
#include "qwt_plot.h"
#include "qwt_plot_curve.h"
#include <QApplication>
void addCurve(QwtPlot *plot, const QPolygonF &points, QColor color, qreal width, qreal alpha)
{
QwtPlotCurve *curve = new QwtPlotCurve();
color.setAlphaF(alpha);
curve->setPen(color,width);
curve->setSamples(points);
curve->setRenderHint(QwtPlotItem::RenderAntialiased);
curve->attach(plot);
}
int main( int argc, char* argv[] )
{
QApplication app( argc, argv );
QwtPlot plot;
plot.setCanvasBackground(QBrush(QColor(64,64,64)));
QPolygonF points;
for (float t = 0.0; t < 10.0; t+=0.1f)
points << QPointF(t,std::sin(t));
addCurve(&plot, points, Qt::green, 16, 0.05);
addCurve(&plot, points, Qt::green, 10, 0.1);
addCurve(&plot, points, Qt::green, 6, 0.15);
addCurve(&plot, points, Qt::white, 2, 0.25);
plot.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks