thank you a lot, i like this example !!!
i understand a little now
Added after 1 33 minutes:
i have try to plote something but it don't work (i don't show something)
This is my main.cpp
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <vector>
#include "fonction.h"
using namespace std;
int main(int argc, char **argv)
{
for (int i=1;i<10;i++)
{
vector<double>coord;
coord=fonction();
points <<
QPointF( coord
[0],coord
[1] ) ;
curve->attach( &plot );
plot.replot();
}
plot.resize(600,400);
plot.show();
return a.exec();
}
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <vector>
#include "fonction.h"
using namespace std;
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QwtPlot plot;
QwtPlotCurve *curve = new QwtPlotCurve();
for (int i=1;i<10;i++)
{
QPolygonF points;
vector<double>coord;
coord=fonction();
points << QPointF( coord[0],coord[1] ) ;
curve->attach( &plot );
plot.replot();
}
plot.resize(600,400);
plot.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
and my fonction:
#include <vector>
#include <ctime> // to generate random point
#include <cstdlib> // to generate random point
#include "fonction.h"
using namespace std;
vector<double> fonction()
{
vector<double> points;
srand(time(0));
points.clear();
points.push_back(rand() % 1800);
points.push_back(rand() % 500);
return points;
}
#include <vector>
#include <ctime> // to generate random point
#include <cstdlib> // to generate random point
#include "fonction.h"
using namespace std;
vector<double> fonction()
{
vector<double> points;
srand(time(0));
points.clear();
points.push_back(rand() % 1800);
points.push_back(rand() % 500);
return points;
}
To copy to clipboard, switch view to plain text mode
and his header:
#ifndef FONCTION_H
#define FONCTION_H
std::vector<double> fonction();
#endif // FONCTION_H
#ifndef FONCTION_H
#define FONCTION_H
std::vector<double> fonction();
#endif // FONCTION_H
To copy to clipboard, switch view to plain text mode
can you explain me, how i can plot this curve. I want to différente version: with line between point and without line
Bookmarks