Hello everyone,
This is my first post on the forums. I've lurked on a few threads trying to understand how the Qwt spectrogram example can take data, but I can't get my head around QwtRasterData.
{
public:
SpectrogramData():
{
}
{
return new SpectrogramData();
}
{
}
virtual double value(double x, double y) const
{
const double c = 0.842;
const double v1 = x * x + (y-c) * (y+c);
const double v2 = x * (y+c) + x * (y+c);
return 1.0 / (v1 * v1 + v2 * v2);
}
};
class SpectrogramData: public QwtRasterData
{
public:
SpectrogramData():
QwtRasterData(QwtDoubleRect(-1.5, -1.5, 3.0, 3.0))
{
}
virtual QwtRasterData *copy() const
{
return new SpectrogramData();
}
virtual QwtDoubleInterval range() const
{
return QwtDoubleInterval(0.0, 10);
}
virtual double value(double x, double y) const
{
const double c = 0.842;
const double v1 = x * x + (y-c) * (y+c);
const double v2 = x * (y+c) + x * (y+c);
return 1.0 / (v1 * v1 + v2 * v2);
}
};
To copy to clipboard, switch view to plain text mode
My data is an 11x11 array (double data[11][11];). Each entry is depicting a 1x1cm^2 area from a detector. How could I modify the spectrogram example to display my data?
Secondary: Would there be a way to disable interpolation?
Thank you.
Mr_Cloud
Bookmarks