Results 1 to 3 of 3

Thread: how to hide the scale in qwt plot

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default how to hide the scale in qwt plot

    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.


    Qt Code:
    1. #include <QtGui>
    2.  
    3. #include "qwt_plot.h"
    4. #include "qwt_plot_curve.h"
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication a(argc, argv);
    9.  
    10. QwtPlot *plot=new QwtPlot();
    11.  
    12. c->attach(plot);
    13. c->setPen(QPen(Qt::blue));
    14. double x[1000], y[1000];
    15. for (int i=0; i<1000; i++)
    16. {
    17. if (i<100 && i>10)y [i]=1;
    18. else
    19. y[i]=0;
    20.  
    21. x[i]=i;
    22. }
    23. c->setData(x,y,1000);
    24. plot->axisWidget(QwtPlot::yLeft)->hide(); //this does not work
    25. plot->show();
    26.  
    27. return a.exec();
    28. }
    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.
    Last edited by babu198649; 4th March 2008 at 09:36.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to hide the scale in qwt plot


  3. The following user says thank you to Uwe for this useful post:

    babu198649 (7th March 2008)

  4. #3
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: how to hide the scale in qwt plot

    thanks ume ,
    it worked ,but why
    Qt Code:
    1. axisWidget(QwtPlot::yLeft)->hide();
    To copy to clipboard, switch view to plain text mode 
    this does not work.

Similar Threads

  1. Replies: 4
    Last Post: 10th October 2009, 17:59
  2. qwt 5 log scale..
    By halberdier83 in forum Qwt
    Replies: 7
    Last Post: 12th November 2007, 07:21
  3. Qwt plot problem on compile
    By sincnarf in forum Qwt
    Replies: 2
    Last Post: 14th October 2007, 11:36
  4. My own scale widget in Qwt
    By igrms in forum Qwt
    Replies: 7
    Last Post: 15th June 2006, 21:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.