PDA

View Full Version : Irregular data and QwtPlotSpectrogram



seveninches
26th January 2008, 11:31
Hi there,

Basically I have an irregular grid of three dimensional data, where x,y specify a point, and Z specifies elevation (some value in specific range), and I need to color it. Since the x,y coordinates in value() do not match mine, I have to interpolate them. What's the suggested way to plot the irregular data on the QwtPlotSpectrogram? My problem is that I have only few points, and the contours on the spectrogram looks too sharp. Is there any way to enable the interpolation for contours (i.e. have the Qwt draw an arc instead of a line between two points)?

Uwe
27th January 2008, 11:52
Basically I have an irregular grid of three dimensional data, where x,y specify a point, and Z specifies elevation (some value in specific range), and I need to color it. Since the x,y coordinates in value() do not match mine, I have to interpolate them. What's the suggested way to plot the irregular data on the QwtPlotSpectrogram?
I'm not sure what you mean by "irregular", but of course most applications will need to implement some sort of resampling in their raster data class.


My problem is that I have only few points, and the contours on the spectrogram looks too sharp. Is there any way to enable the interpolation for contours (i.e. have the Qwt draw an arc instead of a line between two points)?
With QwtRasterData::rasterHint() and QwtPlotSpectrogram::contourRasterSize() you have some effect on the contouring algo.

Qwt implements the CONREC ( http://local.wasp.uwa.edu.au/~pbourke/papers/conrec ) algo. This one produces lines, nothing else. You can try to make polygons of them, but probably it's easier to generate a contour of points by running one by one over the raster data and to pass it to a vectorizer.

An algorithm that produces polygons instead of lines would be great, because it could be used to replace the pixel matrix (QImage) by polygons for spectograms with fixed color maps. This could drastically reduce the amount of memory ( consider A0 images in high resolution ) that is needed for printing.

Uwe