Results 1 to 5 of 5

Thread: Fixed size axes

  1. #1
    Join Date
    May 2009
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default Fixed size axes

    Hi,
    the solution is probably very simple, but I cannot figure it out...
    How can you set the size of an axis (or, of the plotting area)?
    The reason is that I have 4 plots below each other, the y-as being time, and the x-as being 4 different units. I want the plots to be exactly aligned, even if the x-axes have different widths.
    Any way I can do this?
    Thanks a lot for any hint!
    Wim

  2. #2
    Join Date
    May 2009
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default Re: Fixed size axes

    Hi,
    maybe it's not clear enough what I mean. Here's a screenshot:



    What would be the best way to make all graphs the same width (so the time axes are nicely aligned)?

    Thanks for any help!
    Wim

  3. #3
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Fixed size axes

    Hi Wim,

    there is a way to fix the scale of an axis.
    Use: setAxisScale(AxisID, min, max)

    But than there is no automatic scaling anymore.
    If you want to rescale you have to do it by yourself.

    If you want to set the axisscale to automatic mode you have to do:
    setAxisAutoScale(AxisID)

    And remember: After every change on the QwtPlot use the replot function!

    I hope that will help you

    daduda

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Fixed size axes

    In the SVN repository of Qwt (trunk) you find a plotmatrix example, that shows how to align plots.

    Uwe

  5. #5
    Join Date
    May 2009
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default Re: Fixed size axes

    Hi,
    thanks a lot, the example pointed me in the right direction!

    It can easily be solved with:
    self.ui.myPlot.axisScaleDraw(QwtPlot.yLeft).setMin imumExtent(100)

    Thanks!!
    Wim

Similar Threads

  1. Replies: 2
    Last Post: 22nd September 2008, 09:22
  2. Qt Designer - Fixed size main form
    By nleverin in forum Newbie
    Replies: 3
    Last Post: 25th April 2008, 19:54
  3. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  4. Print html on fixed size
    By mamyte03@gmail.com in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2007, 10:33
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22: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.