Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Usage about QwtPlot
Qt 6.11 is out! See what's new in the release blog

Usage about QwtPlot

Scheduled Pinned Locked Moved 3rd Party Software
1 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HYSuperman
    wrote on last edited by
    #1

    I'm confused with using QwtPlot class to draw a customized coordinate system.
    My goal is to draw a coordinate system with customized scale, and draw grid line on these customized scales. Here are the value of the scales:

    x-axis and y-axis scale:
    x1=-0.642455
    x2=0
    x3=0.642455
    y1=-0.642455
    y2=0
    y3=0.642455

    I read the user's guide of "QwtPlot class":http://qwt.sourceforge.net/class_qwt_plot.html and "QwtPlotGrid class":http://qwt.sourceforge.net/class_qwt_plot_grid.html. I found a function in QwtPlotGrid class called setxDiv and seemed that it could help, So I wrote the following code:
    @
    QList<double> doubleListmin;//min scale
    QList<double> doubleListmed;//medium scale
    QList<double> doubleListmaj;//major scale
    doubleListmin.append(0.1);
    doubleListmed.append(0.3);
    doubleListmaj.append(0.642455);
    QList<double> doubleList[3];
    doubleList[0] = doubleListmin;
    doubleList[1] = doubleListmed;
    doubleList[2] = doubleListmaj;
    QwtScaleDiv *xDiv = new QwtScaleDiv(-0.642455, 0.642455, doubleList);//lowerbound is -0.642455, upperbound is 0.642455, doubleList customizes the scale

    QwtPlotGrid *grid = new QwtPlotGrid();
    grid->setXDiv(*xDiv);
    //grid->updateScaleDiv(*xDiv, *xDiv);
    grid->attach(this);
    

    @

    But it turned out to have no influence on the new QwtPlotGrid, it doesn't change its scale system.

    I think there's another way: draw a several lines in the QwtPlot. But I don't know how to do it.

    Somebody help me please!!!
    Thank you in advance~

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved