#include <QtGui>
#include "qwt_plot.h"
#include <qwt_plot_curve.h>
#include <qwt_legend.h>
static const double x[] = { 0.0, 1.0, 2.0, 3.0 };
static const double y[] = { 0.0, 1.0, 4.0, 9.0 };
int main(int argc, char **argv)
{
myPlot.setTitle("Test");
myPlot.
setAxisTitle( QwtPlot::xBottom,
"X" );
myPlot.
setAxisTitle( QwtPlot::yLeft,
"Y" );
myPlot.
insertLegend( legend,
QwtPlot::BottomLegend );
curve
->setPen
(QColor(Qt
::red));
curve->setSamples(x, y, 4);
curve->attach(&myPlot);
myPlot.setEnabled(false);
myPlot.show();
return app.exec();
}
#include <QtGui>
#include "qwt_plot.h"
#include <qwt_plot_curve.h>
#include <qwt_legend.h>
static const double x[] = { 0.0, 1.0, 2.0, 3.0 };
static const double y[] = { 0.0, 1.0, 4.0, 9.0 };
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QwtPlot myPlot;
myPlot.setTitle("Test");
myPlot.setAxisTitle( QwtPlot::xBottom, "X" );
myPlot.setAxisTitle( QwtPlot::yLeft, "Y" );
QwtLegend *legend = new QwtLegend;
myPlot.insertLegend( legend, QwtPlot::BottomLegend );
QwtPlotCurve *curve = new QwtPlotCurve("Curve");
curve->setLegendAttribute( QwtPlotCurve::LegendShowLine );
curve->setPen(QColor(Qt::red));
curve->setSamples(x, y, 4);
curve->attach(&myPlot);
myPlot.setEnabled(false);
myPlot.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks