Results 1 to 3 of 3

Thread: generating graph with unequal intervals using QCustomPlot in Qt

  1. #1
    Join Date
    Jun 2015
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default generating graph with unequal intervals using QCustomPlot in Qt

    I am able to generate the graph with equal intervals on both the axis using QCustomPlot .But i need to generate dynamically with unequal intervals.

    How can we generate graph with unequal intervals in x and y axis using QCustomPlot.

  2. #2
    Join Date
    Jan 2008
    Alameda, CA, USA
    Thanked 808 Times in 797 Posts
    Qt products
    Windows Android

    Default Re: generating graph with unequal intervals using QCustomPlot in Qt

    QCustomPlot is not part of Qt, it is an external library. I suggest you go to the QCustomPlot forum and ask there.

    Edit - which I see you did, so never mind. You probably want this:

    void QCPAxis::setTickVector ( const QVector< double > & vec )

    If you want full control over what ticks (and possibly labels) the axes show, this function is used to set the coordinates at which ticks will appear. setAutoTicks must be disabled, else the provided tick vector will be overwritten with automatically generated tick coordinates upon replot. The labels of the ticks can be generated automatically when setAutoTickLabels is left enabled. If it is disabled, you can set the labels manually with setTickVectorLabels.

    vec is a vector containing the positions of the ticks, in plot coordinates.
    Last edited by d_stranz; 6th June 2015 at 16:37.

  3. #3
    Join Date
    Mar 2009
    Brisbane, Australia
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Unix/X11 Windows
    Wiki edits

    Default Re: generating graph with unequal intervals using QCustomPlot in Qt

    See the code snippet for the Bar Chart Demo on the QCustomPlot front page.

Similar Threads

  1. how to implement scale intervals
    By g_daniel_g in forum Qwt
    Replies: 0
    Last Post: 15th August 2014, 11:46
  2. QCustomplot
    By Harshavardhan in forum Newbie
    Replies: 1
    Last Post: 10th March 2014, 20:13
  3. Arranging Qwt plots of unequal sizes
    By bigjoeystud in forum Qwt
    Replies: 1
    Last Post: 23rd September 2013, 17:13
  4. Help with QCustomPlot
    By aashok91 in forum Qt Programming
    Replies: 0
    Last Post: 9th January 2013, 00:56
  5. Replies: 6
    Last Post: 26th October 2010, 09:02

Tags for this Thread


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.