Greetings,
how do I crop/clip/erase those contours, that are outside of data?
Greetings,
how do I crop/clip/erase those contours, that are outside of data?
The contour lines are calculated from your data - so they can't be outside.
Are spectrogram and contour lines displayed from the same data object and the same plot item ?
Is your image a screenshot or something you generated with QwtPlot::print.
How did you limit the area of your spectrogram ?
Uwe
within SpectrogramData:QwtRasterData. The spectrogram itself is bounded correctly.Qt Code:
setBoundingRect(QwtDoubleRect(xmin,ymin,xmax-xmin,ymax-ymin));To copy to clipboard, switch view to plain text mode
regarding the raster data and contour data -
Qt Code:
SpectrogramData D(fopen("in.txt","r")); S->setData(D); S->attach(Plot); QwtValueList contourLevels; ...calculating contourlevels... S->setContourLevels(contourLevels); Plot->replot();To copy to clipboard, switch view to plain text mode
Screenshot is taken by pressing PRINT SCREEN, cropping with mspaint and posting as jpeg.
Last edited by Keir; 17th February 2009 at 09:10.
This is a bug in Qwt, but you can work around it easily:
Qt Code:
virtual ContourLines YourRasterData::contourLines( const QwtDoubleRect &rect, int flags) const { QwtDoubleRect area = rect; if ( boundingRect().isValid() ) area &= boundingRect(); }To copy to clipboard, switch view to plain text mode
Or you can use the code from SVN ( 5.2 branch ).
Uwe
Keir (20th February 2009)
Superb! Thank you.
Hi,
I am also trying to use contour in my program and confused about the qwt contour program. Do I need to implement some contour algorithm to fill my data with points of (x, y, v) or those points have been figured out by the qwt library? I mean, I have a set of (x, y, v) points but the number of those points is just a few and cannot certainly fill up all the display. And if I am to enter the data, where in the Qwt structure should I enter them?
Any help is greatly appreciated.
Sincerely,
Wieland J.
Bookmarks