jesse brockmann | 9 Feb 19:15
Picon

changing intervals

So, I have a graph with X values from 0 to 17, Major Intervals is 10, Minor is 5.   But, I would like the major intervals to be 0, 1.7, 3.4 ... 17   NOT 0, 2, 4, 6, 8 ... 16.   Is there any way to do this?   Not my choice, but I have to do it. *sigh*

Thanks,
JesseJay

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
David Stranz | 9 Feb 19:25

Re: changing intervals

The standard scale widget is implemented to create "nice" intervals for 
tic marks, which is what one normally sees on published plots.

You can override this to produce tic marks at any intervals by 
implementing your own QwtScaleEngine and overriding the divideScale() 
method and returning your own QwtScaleDiv division.

David

_______________________________________________________________
David Stranz, Ph.D.	david_stranz <at> MassSpec.com

Sierra Analytics, Inc.
5815 Stoddard Road, Suite 601
Modesto, CA  95356

Tel: (209) 545-8508
http://www.massspec.com
_______________________________________________________________

On 2/9/2012 10:15 AM, jesse brockmann wrote:
> So, I have a graph with X values from 0 to 17, Major Intervals is 10,
> Minor is 5.   But, I would like the major intervals to be 0, 1.7, 3.4
> ... 17   NOT 0, 2, 4, 6, 8 ... 16.   Is there any way to do this?   Not
> my choice, but I have to do it. *sigh*
>
> Thanks,
> JesseJay
>
>
> ------------------------------------------------------------------------------
> Virtualization&  Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>
>
>
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Uwe Rathmann | 9 Feb 20:46
Picon

Re: changing intervals

On 02/09/2012 07:25 PM, David Stranz wrote:
> You can override this to produce tic marks at any intervals by
> implementing your own QwtScaleEngine and overriding the divideScale()
> method and returning your own QwtScaleDiv division.

Or you can assign your ticks "manually" using QwtPlot::setAxisScaleDiv().

Uwe

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Axel Huelsmann | 9 Feb 22:02
Picon
Favicon

Re: changing intervals

Does this code help you?

#include <QtGui/QApplication>
#include <qwt_plot.h>
#include <qwt_plot_histogram.h>
#include <qwt_series_data.h>

int main(int argc, char **argv)
{
    QApplication a(argc, argv);
    QwtPlot plot;
    QwtPlotHistogram *histogram = new QwtPlotHistogram();

    const float Values[] = {1.3,2,5,10,7,5};

    QVector<QwtIntervalSample> samples(sizeof(Values)/sizeof(Values[0]));
    for ( int i = 0; i < samples.count(); i++ )
    {
        QwtInterval interval(i + 0.1, i + 0.9);
        samples[i] = QwtIntervalSample(Values[i], interval);
    }

    histogram->setData(new QwtIntervalSeriesData (samples));
    histogram->attach(&plot);

    plot.resize(600,400);
    plot.show();

    return a.exec();
}
axhuelsmann


Von: jesse brockmann <jjbrockm <at> gmail.com>
An: qwt-interest <at> lists.sourceforge.net
Gesendet: 19:15 Donnerstag, 9.Februar 2012
Betreff: changing intervals

So, I have a graph with X values from 0 to 17, Major Intervals is 10, Minor is 5.   But, I would like the major intervals to be 0, 1.7, 3.4 ... 17   NOT 0, 2, 4, 6, 8 ... 16.   Is there any way to do this?   Not my choice, but I have to do it. *sigh*

Thanks,
JesseJay

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest

Gmane