hi
i want to hide the y-axis(QwtPlot::yLeft) in the qwt plot how to do it .
how to hide y-axis in the following program.
#include <QtGui>
#include "qwt_plot.h"
#include "qwt_plot_curve.h"
int main(int argc, char *argv[])
{
c->attach(plot);
c
->setPen
(QPen(Qt
::blue));
double x[1000], y[1000];
for (int i=0; i<1000; i++)
{
if (i<100 && i>10)y [i]=1;
else
y[i]=0;
x[i]=i;
}
c->setData(x,y,1000);
plot
->axisWidget
(QwtPlot::yLeft)->hide
();
//this does not work plot->show();
return a.exec();
}
#include <QtGui>
#include "qwt_plot.h"
#include "qwt_plot_curve.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QwtPlot *plot=new QwtPlot();
QwtPlotCurve *c = new QwtPlotCurve();
c->attach(plot);
c->setPen(QPen(Qt::blue));
double x[1000], y[1000];
for (int i=0; i<1000; i++)
{
if (i<100 && i>10)y [i]=1;
else
y[i]=0;
x[i]=i;
}
c->setData(x,y,1000);
plot->axisWidget(QwtPlot::yLeft)->hide(); //this does not work
plot->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
in the 25 th line i have tried to get the scale widget and tried to hide it even the it is not successful.
Bookmarks