Vitali Anselm | 1 Mar 2010 13:43
Picon

(unknown)

 Hello,



I wonder whether it is possible to get the actual min and max range values of spectrogram and not to set them manually, like I do it now (see the code below). I mean, after the data for spectrogram was calculated, then the max and min values should be known, right? How to get them then? I don't want to set the range manually, but it should be done according to the current data. Help me please.

 

best regards,

 

Vitali



[CODE]typedef double (*benchFunc)(vector<double>);    // definition of function pointer for benchmark function

// this class creates the data of objective function

class SpectrogramData: public QwtRasterData
{
public:
    SpectrogramData(benchFunc b, double rang1[2],  double rang2[2], int dims[2], vector<double> fix_vec , unsigned dimens, QwtDoubleInterval interval ):
        QwtRasterData(QwtDoubleRect(rang1[0], rang2[0], rang1[1]- rang1[0], rang2[1]- rang2[0]))
    {
        MybenchFunc = b;
        valuesRange = interval;                                 //<<<<<<<<<< here it is set manually
        dim_ind[0] = dims[0];  dim_ind[1] = dims[1];
        dimensions = dimens;
        fix_vals = fix_vec;
    }

    virtual QwtRasterData *copy() const
    {
        return new SpectrogramData(*this);
    }

    virtual QwtDoubleInterval range() const          //<<<<<<<<<<< here the range will be returned
    {
        return valuesRange;
    }

    virtual double value(double x, double y) const
    {
        vector<double> coords;
        coords = vector<double>(dimensions, 0);        // create a vector of size "dimensions" containing zeros
        if(dimensions > 2){        // if the benchmark function has more dimensions than 2, then...
            for(unsigned i=0 ; i < dimensions ; ++i){
                coords[i] = fix_vals[i];    // ... copy first all fixed values into vector and then...
            }
            coords[dim_ind[0]] = x;        // replace the values of dimensions to be visualized
            coords[dim_ind[1]] = y;
        }
        else{
            coords[dim_ind[0]] = x;
            coords[dim_ind[1]] = y;
        }
        const double result = MybenchFunc( coords);
        return result;
    }

private:

    benchFunc MybenchFunc;    // function pointer for benchmark function
    QwtDoubleInterval valuesRange;
    int dim_ind[2];
    unsigned dimensions;
    vector<double> fix_vals;
};[/CODE]

  

GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!   
Jetzt freischalten unter http://movieflat.web.de
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Charlie Martin | 2 Mar 2010 04:25
Picon
Favicon

Re: rubberband zoom on Mac


On Feb 27, 2010, at 6:42, Uwe Rathmann wrote:

>> Are there any suggestions as to how I could get this to work?
> 
> Never heard about such an incompatibility, but unfortunately I don't have a 
> Mac to confirm thi. So I'm afraid you are on your own to identify the source of 
> this problem.
> 
> Uwe
> 

Can anyone else verify if the rubberband zoom (in the bode plot) works on the Mac?

I guess I'm a bit lost "on my own". However, if someone could give me some ideas of where to start, I could give
it a try.

Thanks,
Charlie

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Joey Mukherjee | 2 Mar 2010 16:17
Favicon

Re: rubberband zoom on Mac


On Mar 1, 2010, at 9:25 PM, Charlie Martin wrote:

>> Can anyone else verify if the rubberband zoom (in the bode plot) works on the Mac?
> 
> I guess I'm a bit lost "on my own". However, if someone could give me some ideas of where to start, I could give
it a try.

I can verify that I saw this problem with Qt 4.5.2 but it is gone with Qt 4.6.2!  So I hope you are allowed to
upgrade Qt.

Joey
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
PaceyIV | 2 Mar 2010 20:49
Picon

How to readjust the axes of the plot when you hide some curves?

Hi,
I've got a plot with some curves and I use the methods indicated in
the cpu-plot example for hiding and show the curves when I click on
the corresponding legend item. But in this way the axes do not scale
according to the range of the visible data.
How should I proceed?

Thanks,
Albano

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
harold garbeil | 2 Mar 2010 22:30
Favicon

Re: no curve visible

David,
I did try this but still have a frame with properly scaled axes but no 
plot curve.
thanks
harold

------------------------------------------------------------------------

Subject:
Re: no curve visible
From:
David Stranz <David_Stranz <at> MassSpec.com>
Date:
Fri, 26 Feb 2010 12:56:39 -0800
To:
List for both Qwt users and developers <qwt-interest <at> lists.sourceforge.net>

To:
List for both Qwt users and developers <qwt-interest <at> lists.sourceforge.net>

Harold,

It looks OK.  Try adding curve1->setStyle( QwtPlotCurve::Lines );
Could be the default is QwtPlotCurve::NoCurve.

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
_______________________________________________________________

harold garbeil wrote:
> Greetings
> I have been trying out qwt with a very simple application. I have not 
> been able to get the plot to appear in the MainWindow but the curve is 
> not visible. I am running qwt-5.2.0 with qt 4.6.2. Everything compiles 
> fine, with the plot showing with proper axis scaling. Only thing 
> missing is the curve. The code is fairly simple, with my "myPlot" 
> (derived from QwtPlot) class looking like the following ...
>
> #include "myplot.h"
>
> MyPlot::MyPlot(QWidget *gv) : QwtPlot ( gv)
> {
>     int i ;
>
>     setTitle ("junk") ;
>     QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
>     curve1->attach(this);
>       // alloc memory for data arrays
>     xdata = new double [100] ;
>     ydata = new double [100] ;
>  
>     //load up test data
>     for (i = 0; i < 100; i++)
>     {
>                     xdata[i] = i ;
>                     ydata[i] = i ;
>     }
>
>     curve1->setRawData(xdata, ydata, 100);
>     curve1->setPen(QPen(Qt::red, 3));
>
>     this->replot() ;
>
> }
> ~                                                                               
>
> ~                                                                               
>
>
> This is placed in a MainWindow with the following constructor for the 
> MainWindow via
>
> #include "mainwindow.h"
> #include "ui_mainwindow.h"
>
>
> MainWindow::MainWindow(QWidget *parent) :
>     QMainWindow(parent),
>     ui(new Ui::MainWindow)
> {
>     ui->setupUi(this);
>
>     myPlot = new MyPlot (this) ;
>     this->setCentralWidget (myPlot) ;
>
>     // do the replot in constructor for myPlot....
>     //myPlot->replot() ;
> }
>
> Thanks for any help you can provide
>
>
>
> ------------------------------------------------------------------------------ 
>
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest
>
>
>

>
> Subject:
> no curve visible
> From:
> harold garbeil <harold <at> higp.hawaii.edu>
> Date:
> Fri, 26 Feb 2010 10:48:12 -1000
> To:
> qwt-interest <at> lists.sourceforge.net
>
> To:
> qwt-interest <at> lists.sourceforge.net
>
>
> Greetings
> I have been trying out qwt with a very simple application. I have not 
> been able to get the plot to appear in the MainWindow but the curve is 
> not visible. I am running qwt-5.2.0 with qt 4.6.2. Everything compiles 
> fine, with the plot showing with proper axis scaling. Only thing 
> missing is the curve. The code is fairly simple, with my "myPlot" 
> (derived from QwtPlot) class looking like the following ...
>
> #include "myplot.h"
>
> MyPlot::MyPlot(QWidget *gv) : QwtPlot ( gv)
> {
>    int i ;
>
>    setTitle ("junk") ;
>    QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
>    curve1->attach(this);
>  
>    // alloc memory for data arrays
>    xdata = new double [100] ;
>    ydata = new double [100] ;
>
>    //load up test data
>    for (i = 0; i < 100; i++)
>    {
>                    xdata[i] = i ;
>                    ydata[i] = i ;
>    }
>
>    curve1->setRawData(xdata, ydata, 100);
>    curve1->setPen(QPen(Qt::red, 3));
>
>    this->replot() ;
>
> }
> ~                                                                               
>
> ~                                                                               
>
>
> This is placed in a MainWindow with the following constructor for the 
> MainWindow via
>
> #include "mainwindow.h"
> #include "ui_mainwindow.h"
>
>
> MainWindow::MainWindow(QWidget *parent) :
>    QMainWindow(parent),
>    ui(new Ui::MainWindow)
> {
>    ui->setupUi(this);
>
>    myPlot = new MyPlot (this) ;
>    this->setCentralWidget (myPlot) ;
>
>    // do the replot in constructor for myPlot....
>    //myPlot->replot() ;
> }
>
> Thanks for any help you can provide
>
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Uwe Rathmann | 3 Mar 2010 07:54
Picon

Re: How to readjust the axes of the plot when you hide some curves?

> I've got a plot with some curves and I use the methods indicated in
> the cpu-plot example for hiding and show the curves when I click on
> the corresponding legend item. But in this way the axes do not scale
> according to the range of the visible data.

Also do "curve->setItemAttribute(QwtPlotItem::AutoScale, false);" to remove 
hidden items from autoscaling.

Uwe

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
PaceyIV | 3 Mar 2010 09:35
Picon

Re: How to readjust the axes of the plot when you hide some curves?

Thanks a lot.

I do it with the item provided by the checked signal of the plot.

item->setVisible(on);
item->setItemAttribute(QwtPlotItem::AutoScale, on);

Albano

On Wed, Mar 3, 2010 at 7:54 AM, Uwe Rathmann <Uwe.Rathmann <at> tigertal.de> wrote:
>> I've got a plot with some curves and I use the methods indicated in
>> the cpu-plot example for hiding and show the curves when I click on
>> the corresponding legend item. But in this way the axes do not scale
>> according to the range of the visible data.
>
> Also do "curve->setItemAttribute(QwtPlotItem::AutoScale, false);" to remove
> hidden items from autoscaling.
>
> Uwe
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Giacomo | 5 Mar 2010 12:12
Picon

Right place to calculate scale division according to axis length

Hi to all.
I have an x axis representing timestamps.
I want to divide the available space on the axis according to the dimension 
(in pixels) of the axis scale, and set the number of ticks proportionally to 
the number of pixels of the scale. 
I'd like to know which is the right place (also in terms of efficience) to 
calculate the scale division and apply it.

I was also looking for, if someone has already implemented it, an algorithm to 
nicely distribute the time labels on the x axis.

So far, I reimplement QwtScaleDraw::label(double ) virtual function to convert 
timestamps into a string representing hours mins and secs.

Any suggestion on how to divide scale will be appreciated.
 Thanks

Giacomo.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Carlos Pascual Izarra | 10 Mar 2010 12:41
Picon

Re: Mailing list dead? / Expensive CPU usage when plotting 1000 points 10 times per sec.

Hi Giacomo,

We have implemented that for our TauPlot. It draws the timestamps using 
human-readable strings that change dynamically depending on the range (e.g., 
it skips putting the year if you are looking at a minutes range)

Have a look at the code for the TauTimeScale class (and its parent 
FancyScaleDraw). It is python, not C, but you may get an idea:
https://tango-cs.svn.sourceforge.net/svnroot/tango-cs/tau/trunk/lib/tau/widget/qwt/scales.py

Hope it helps.

On Wednesday 10 March 2010 12:21:03 Giacomo wrote:
> Hi to all.
> I have an x axis representing timestamps.
> I want to divide the available space on the axis according to the dimension
> (in pixels) of the axis scale, and set the number of ticks proportionally
> to the number of pixels of the scale.
> I'd like to know which is the right place (also in terms of efficience) to
> calculate the scale division and apply it.
>
> I was also looking for, if someone has already implemented it, an algorithm
> to nicely distribute the time labels on the x axis.
>
> So far, I reimplement QwtScaleDraw::label(double ) virtual function to
> convert timestamps into a string representing hours mins and secs.
>
> Any suggestion on how to divide scale will be appreciated.
>  Thanks
>
> Giacomo.

--

-- 
+----------------------------------------------------+
 Carlos Pascual Izarra
 Scientific Software Contact 
 Computing Division
 Cells / Alba Synchrotron  [http:/www.cells.es]
 Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
 E-08290 Cerdanyola del Valles (Barcelona), Spain
 E-mail: carlos.pascual <at> cells.es
 Phone: +34 93 592 4428
+----------------------------------------------------+

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Giacomo | 10 Mar 2010 12:21
Picon

Mailing list dead? / Expensive CPU usage when plotting 1000 points 10 times per sec.

Hi Uwe, Hi to all in the mailing list.

First of all, is the mailing list still alive?
I have stopped receiving mail from qwt-interest since a week.

I have a QwtPlot that replots a curve of 1000 points at 10Hz.

When the plot window is small, the cpu usage is reasonable.
Increasing the application window (the plot area), the CPU goes 100% and the 
application hangs.

I underline that the application CPU usage is low, but X goes 100%.

In the case of appending one point at a time, using the low level draw() 
method and the canvas attributes indicated in the realtime plot example, the 
performance is much better.

Is there any way to improve my plot in the case of full vector update?

The mail I sent to the mailing list last friday is attached below. Can someone 
help with that too?

Thanks

--------------------------------------------------------------------------------------------------------------------------------------------------------
Hi to all.
I have an x axis representing timestamps.
I want to divide the available space on the axis according to the dimension 
(in pixels) of the axis scale, and set the number of ticks proportionally to 
the number of pixels of the scale. 
I'd like to know which is the right place (also in terms of efficience) to 
calculate the scale division and apply it.

I was also looking for, if someone has already implemented it, an algorithm to 
nicely distribute the time labels on the x axis.

So far, I reimplement QwtScaleDraw::label(double ) virtual function to convert 
timestamps into a string representing hours mins and secs.

Any suggestion on how to divide scale will be appreciated.
 Thanks

Giacomo.

--------------------------------------------------------------------------------------------------------------------------------------------------------

Thanks in advance.

Giacomo. 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

Gmane