Results 1 to 2 of 2

Thread: One scale widget for multiple x-axis

  1. #1
    Join Date
    Nov 2019
    Posts
    30
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default One scale widget for multiple x-axis

    Hi,

    I have many vertical time-domain signals (see picture). Every signal (timeseries of X, Y points) is displaced from line X = 0 by some value so the median value of signal is equal to some X axis -value.
    Besides every signal has some additional data that should be displayed (on the picture this data is displayed as few additional X-axis). Lets suppose that this data is a single value for each signal but this data has no increasing or decreasing tendency. How would you recommend me to implement this?
    I can see two ways: either I display such data in additional scale widget (but here is the problem that data has no increasing or decreasing sorting, how to deal with that?) or I could display this data as a pop-up window that appears when user click on a signal.
    What would you recommend me? Is there a way to dasplay few non sorted lines of numbers (matrix) in scale widget as in the picture?
    1.jpg

  2. #2
    Join Date
    Nov 2019
    Posts
    30
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: One scale widget for multiple x-axis

    I can set ticks with the code:
    Qt Code:
    1. QwtScaleWidget* scaleWidget = new QwtScaleWidget;
    2. QwtScaleDiv scaleDiv;
    3. scaleDiv.setLowerBound(0);
    4. scaleDiv.setUpperBound(20);
    5. QList<double> ticksList;
    6. for (double i = 0; i < 10; i++)
    7. ticksList.push_back(i);
    8.  
    9. ticksList[3] = 16;
    10.  
    11. scaleDiv.setTicks(2, ticksList);
    12. scaleWidget->setScaleDiv(scaleDiv);
    To copy to clipboard, switch view to plain text mode 
    but this draws ticks in the place they should be (ticks are in ascending order every tick corresponds to QwtScaleDiv value).
    But I need to draw ticks which do not correspond to QwtScaleDiv. I need to somehow calculate tick position for every QwtScaleDiv value. For example if QwtScaleDiv has lower value 0 and upper bound 10 then I need to draw tick 30 at QwtScaleDraw equal to 2. How to do that?
    1.png

Similar Threads

  1. Multiple axis - axis detach
    By Khaine in forum Qwt
    Replies: 3
    Last Post: 24th June 2020, 17:40
  2. Replies: 1
    Last Post: 9th September 2013, 07:50
  3. Replies: 2
    Last Post: 16th April 2013, 13:28
  4. qwt axis scale
    By Markus_AC in forum Qwt
    Replies: 0
    Last Post: 15th December 2011, 09:45
  5. Replies: 4
    Last Post: 16th January 2011, 10:32

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.