#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "qwt.h"
#include "qwt_plot.h"
#include <QFileSystemWatcher>
#include "qwt_knob.h"
#include "cmath"
#include "qwt_curve_fitter.h"
#include "qwt_plot_curve.h"
#include "qwt_text.h"
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
double xval[5]={10,20,30,40.4,50};
double yval[5]={1,2.2,3,4,5};
plot.setTitle("first plot");
plot.setTitle("first_plot");
plot.
setAxisTitle(QwtPlot::xBottom,
" System time [h:m:s]");
plot.
setAxisScale(QwtPlot::xBottom,
0,
60 );
plot.
setAxisTitle(QwtPlot::yLeft,
"Degree");
plot.
setAxisScale(QwtPlot::yLeft,
-60,
60 );
plot.setAutoReplot(true);
curve1
->setPen
(QPen(Qt
::blue));
curve1->setRawSamples(xval,yval,5);
curve1->attach(&plot);
plot.replot();
plot.show();
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "qwt.h"
#include "qwt_plot.h"
#include <QFileSystemWatcher>
#include "qwt_knob.h"
#include "cmath"
#include "qwt_curve_fitter.h"
#include "qwt_plot_curve.h"
#include "qwt_text.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
double xval[5]={10,20,30,40.4,50};
double yval[5]={1,2.2,3,4,5};
QwtPlot plot(QwtText("CppQwtExample1"));
plot.setTitle("first plot");
plot.setTitle("first_plot");
plot.setAxisTitle(QwtPlot::xBottom, " System time [h:m:s]");
plot.setAxisScale(QwtPlot::xBottom, 0,60 );
plot.setAxisTitle(QwtPlot::yLeft, "Degree");
plot.setAxisScale(QwtPlot::yLeft, -60,60 );
plot.setAutoReplot(true);
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
curve1->setPen(QPen(Qt::blue));
curve1->setRawSamples(xval,yval,5);
curve1->attach(&plot);
plot.replot();
plot.show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks