Results 1 to 2 of 2

Thread: Alignment of axis when switching between two scales.

  1. #1
    Join Date
    Nov 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Alignment of axis when switching between two scales.

    Hello,
    I have a QwtPlot where the x-axis can be one of two scales - in my case "channels" and "energy"- which are related by a linear transform. I want to be able to toggle the axis between these two scales. When I do this, the x-axis is realigned slightly, because the labels on the tick-marks are of slightly different sizes, and so you see a slight horizontal shift in the plot when you toggle. For example if the rightmost label under the "channels" setting is 255, and the rightmost label under the "energy" setting is 3000, they are each centred under the rightmost tickmark, and since 3000 takes up a little more space, the whole plot is shifted a little to the left.

    I want to prevent this shift from happening.

    Can anyone suggest how I can do this? Is it possible for me to control the location of the axis labels relative to the plot?

    Thanks.

  2. #2
    Join Date
    Nov 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Alignment of axis when switching between two scales.

    Found a solution - by using QwtPlotLayout::setCanvasMargin and setting the right hand margin to a suitably large value, I could prevent the shift that I was getting when toggling the axis scale.

Similar Threads

  1. Replies: 3
    Last Post: 14th April 2012, 09:44
  2. Hiding intervals on axis scales
    By cradle in forum Qwt
    Replies: 5
    Last Post: 8th February 2012, 12:42
  3. Scales alignment
    By fruzzo in forum Qwt
    Replies: 6
    Last Post: 28th September 2011, 16:32
  4. fixed axis scales
    By oskarmellow in forum Qwt
    Replies: 1
    Last Post: 17th December 2008, 06:20
  5. Replies: 10
    Last Post: 18th September 2008, 15:14

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.