Results 1 to 3 of 3

Thread: Problem with zooming the plot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Cool Re: Problem with zooming the plot

    It doesnt matter if you have less points or more points. May be you've implemented wrong. See this for how to implement the zoomer. Or take the reference of Bode plot example.

    Qt Code:
    1. class Zoomer: public QwtPlotZoomer
    2. {
    3. public:
    4. Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
    5. QwtPlotZoomer(xAxis, yAxis, canvas)
    6. {
    7. setTrackerMode(QwtPicker::AlwaysOff);
    8. setRubberBand(QwtPicker::NoRubberBand);
    9.  
    10. // RightButton: zoom out by 1
    11. // Ctrl+RightButton: zoom out to full size
    12.  
    13. setMousePattern(QwtEventPattern::MouseSelect2,
    14. Qt::RightButton, Qt::ControlModifier);
    15. setMousePattern(QwtEventPattern::MouseSelect3,
    16. Qt::RightButton);
    17. }
    18. };
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. QwtPlotZoomer *d_zoomer[2];
    2. d_zoomer[0] = new Zoomer( QwtPlot::xBottom, QwtPlot::yLeft,
    3. d_plot->canvas()); //here replace it with your qwtplot.
    4. d_zoomer[0]->setRubberBand(QwtPicker::RectRubberBand);
    5. d_zoomer[0]->setRubberBandPen(QColor(Qt::green));
    6. d_zoomer[0]->setTrackerMode(QwtPicker::ActiveOnly);
    7. d_zoomer[0]->setTrackerPen(QColor(Qt::white));
    8.  
    9. d_zoomer[1] = new Zoomer(QwtPlot::xTop, QwtPlot::yRight,
    10. d_plot->canvas()); /*here replace it with your plot. Implement this only if you have x is at Top and y is at right position. By seeing the above image, this line is not required. Skip this. */
    To copy to clipboard, switch view to plain text mode 

    I think you've understood.
    Last edited by sonulohani; 26th June 2012 at 11:25.

Similar Threads

  1. Zooming the plot without the marker
    By raghvendramisra in forum Qwt
    Replies: 1
    Last Post: 17th May 2012, 17:24
  2. Replies: 2
    Last Post: 7th October 2011, 15:43
  3. Replies: 13
    Last Post: 20th September 2011, 09:50
  4. QwtPlotZoomer zooming off the plot canvas
    By BettaUseYoNikes in forum Qwt
    Replies: 1
    Last Post: 26th June 2011, 11:38
  5. Qwt Zooming Problem....urgent
    By Raghaw in forum Qwt
    Replies: 0
    Last Post: 2nd September 2009, 15:12

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
  •  
Qt is a trademark of The Qt Company.