Results 1 to 2 of 2

Thread: Problem with QwtPlotZoomer

  1. #1
    Join Date
    Apr 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with QwtPlotZoomer

    Hello,

    I plot data with QwtPlot and QwtPlotCurve and Iwant to zoom in this Plots with QwtPlorZoomer.
    Now I made it like this:

    theta_punkt_title.setText("<font>Nutationsgeschwin digkeit &Theta;'</font>");
    theta_punkt_title.setFont(QFont("Helvetica", 10));
    theta_punkt_curve = new QwtPlotCurve;
    theta_punkt_curve->setPen(QPen(Qt::red,1));
    theta_punkt_curve->setStyle(QwtPlotCurve::Lines);
    theta_punkt_curve->setRenderHint(QwtPlotItem::RenderAntialiased);
    theta_punkt_plot.setCanvasBackground(QColor(Qt::wh ite));
    theta_punkt_plot.setTitle(theta_punkt_title);
    theta_punkt_plot.setMaximumSize(400,300);
    theta_punkt_plot.setAutoReplot(true);
    theta_punkt_plot.resize(300,400);
    line_theta_punkt = new QwtPlotMarker();
    line_theta_punkt->setLineStyle(QwtPlotMarker::VLine);
    line_theta_punkt->setLinePen(QPen(Qt::black));


    theta_punkt_curve->setSamples(time_werte, theta_punkt_werte, size_array);
    theta_punkt_curve->attach(&theta_punkt_plot);
    theta_punkt_plot.setAxisAutoScale(theta_punkt_plot .xBottom, true);
    theta_punkt_plot.setAxisAutoScale(theta_punkt_plot .yLeft, true);
    theta_punkt_zoomer = new QwtPlotZoomer( theta_punkt_plot.canvas() );
    theta_punkt_zoomer->setRubberBandPen( QColor( Qt::black ) );
    theta_punkt_zoomer->setTrackerPen( QColor( Qt::black ) );
    theta_punkt_zoomer->setMousePattern( QwtEventPattern::MouseSelect2, Qt::RightButton, Qt::ControlModifier );
    theta_punkt_zoomer->setMousePattern( QwtEventPattern::MouseSelect3, Qt::RightButton );

    When I plot it like this it work fine, but when I manipulate the data of the plot it plots it correctly.
    But when I zoom in the new plot and then zoom out it goes to the scales of the first plot.
    For example, when my plot goes over a time of 3 seconds and I replot over a time of 6s and I zoom in the second plot, the scales go to 3s by zooming out.
    How can I fix it?
    I hope you can uderstand my problem.

    Christoph
    Last edited by ch_1992; 11th April 2012 at 23:40.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with QwtPlotZoomer

    Do you call QwtPlotZoomer::setZoomBase() when you change the axis range?

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

    missoni (25th April 2012)

Similar Threads

  1. QwtPlotZoomer example
    By ken123 in forum Qwt
    Replies: 2
    Last Post: 20th October 2011, 15:20
  2. QwtPlotZoomer question
    By TorAn in forum Qwt
    Replies: 11
    Last Post: 17th May 2011, 21:56
  3. QwtPlotZoomer, using two zoomers.
    By jma in forum Qwt
    Replies: 2
    Last Post: 30th September 2008, 08:29
  4. Replies: 3
    Last Post: 4th December 2007, 10:04
  5. Problem with QwtPlotZoomer
    By seguprasad in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2007, 08:31

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.