PDA

View Full Version : how to hide the scale in qwt plot



babu198649
4th March 2008, 10:31
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[])
{
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();
}



in the 25 th line i have tried to get the scale widget and tried to hide it even the it is not successful.

Uwe
6th March 2008, 08:09
QwtPlot::enableAxis: see http://qwt.sourceforge.net/class_qwt_plot.html#b644f7a0a0566ff776c89cc225ce37 d7

Uwe

babu198649
7th March 2008, 07:38
thanks ume ,
it worked ,but why
axisWidget(QwtPlot::yLeft)->hide(); this does not work.