#include <cmath>
#include <QApplication>
#include <qwt-qt4/qwt_plot.h>
int main(int argc, char **argv)
{
plot.setGeometry(0,0,640,400);
plot.
setAxisScale(QwtPlot::xBottom,
0.0,
2.0 * M_PI
);
plot.
setAxisScale(QwtPlot::yLeft,
-1.0,
1.0);
std::vector<double> xs;
std::vector<double> ys;
for (double x = 0; x < 2.0 * M_PI; x+=(M_PI / 10.0))
{
xs.push_back(x);
ys.push_back(std::sin(x));
}
sine.setData(&xs[0],&ys[0],xs.size());
sine.attach(&plot);
plot.showFullScreen();
return a.exec();
}
#include <cmath>
#include <QApplication>
#include <qwt-qt4/qwt_plot.h>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QwtPlot plot;
plot.setGeometry(0,0,640,400);
plot.setAxisScale(QwtPlot::xBottom, 0.0,2.0 * M_PI);
plot.setAxisScale(QwtPlot::yLeft,-1.0,1.0);
QwtPlotCurve sine("Sine");
std::vector<double> xs;
std::vector<double> ys;
for (double x = 0; x < 2.0 * M_PI; x+=(M_PI / 10.0))
{
xs.push_back(x);
ys.push_back(std::sin(x));
}
sine.setData(&xs[0],&ys[0],xs.size());
sine.attach(&plot);
plot.showFullScreen();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks