Results 1 to 1 of 1

Thread: How to make a "fake" right Y axis scale?

  1. #1
    Join Date
    Feb 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make a "fake" right Y axis scale?

    Hi all,

    I have a QwtPlotHistogram plotted with a logarithmic scale engine, like this:

    opacityhistogram.jpg

    Now, I'd like the right Y axis scale to go from 0.0 to 1.0, and be synchronized to the left scale such that 1.0 == 1E8.

    Is this possible somehow?

    The reason I want this is because I plan on building an opacity transfer function editor on top of this. E.g. something similar to the opacity transfer function editor in Tomviz:

    tomviz_opacity_editor.jpg

    And I thought it would be nice if I could have both a 0.0-1.0 scale (which relates to the opacity function) and a 1.0-1E8 (roughtly) which relates to the logarithmic histogram (the histogram is there just to guide the user when he/she edits the opacity transfer function).

    Thanks in advance for any advise!


    Added after 7 minutes:


    Sorry, nevermind. It was quite simple:

    plot.enableAxis(QwtPlot::yRight, true);
    plot.setAxisScaleEngine(QwtPlot::yRight, new QwtLinearScaleEngine());
    plot.setAxisScale(QwtPlot::yRight, 0, 1, 0.1);
    Last edited by estan; 19th October 2016 at 11:13.

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 11:02
  2. Replies: 3
    Last Post: 16th March 2015, 08:31
  3. Replies: 4
    Last Post: 18th April 2010, 01:37
  4. "make install" and "make clean" on Windows for Qt
    By Berberis in forum Installation and Deployment
    Replies: 0
    Last Post: 30th November 2009, 00:02
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

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.