qwt-interest Mailing List for qwt
Brought to you by:
rathmann
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(31) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(20) |
Feb
(2) |
Mar
(7) |
Apr
(8) |
May
(19) |
Jun
(9) |
Jul
(36) |
Aug
(16) |
Sep
(6) |
Oct
(16) |
Nov
(11) |
Dec
(37) |
| 2002 |
Jan
(5) |
Feb
(32) |
Mar
(11) |
Apr
(21) |
May
(11) |
Jun
(23) |
Jul
(10) |
Aug
(13) |
Sep
(5) |
Oct
(8) |
Nov
(5) |
Dec
(4) |
| 2003 |
Jan
(12) |
Feb
(29) |
Mar
(20) |
Apr
(38) |
May
(14) |
Jun
(12) |
Jul
(80) |
Aug
(9) |
Sep
(56) |
Oct
(36) |
Nov
(13) |
Dec
(29) |
| 2004 |
Jan
(42) |
Feb
(104) |
Mar
(56) |
Apr
(72) |
May
(44) |
Jun
(84) |
Jul
(53) |
Aug
(43) |
Sep
(62) |
Oct
(96) |
Nov
(42) |
Dec
(53) |
| 2005 |
Jan
(58) |
Feb
(43) |
Mar
(53) |
Apr
(35) |
May
(18) |
Jun
(60) |
Jul
(76) |
Aug
(32) |
Sep
(103) |
Oct
(42) |
Nov
(82) |
Dec
(41) |
| 2006 |
Jan
(74) |
Feb
(47) |
Mar
(68) |
Apr
(94) |
May
(78) |
Jun
(17) |
Jul
(81) |
Aug
(69) |
Sep
(81) |
Oct
(35) |
Nov
(85) |
Dec
(65) |
| 2007 |
Jan
(120) |
Feb
(70) |
Mar
(80) |
Apr
(80) |
May
(98) |
Jun
(93) |
Jul
(69) |
Aug
(62) |
Sep
(90) |
Oct
(126) |
Nov
(121) |
Dec
(82) |
| 2008 |
Jan
(58) |
Feb
(40) |
Mar
(62) |
Apr
(82) |
May
(33) |
Jun
(55) |
Jul
(43) |
Aug
(43) |
Sep
(18) |
Oct
(23) |
Nov
(63) |
Dec
(38) |
| 2009 |
Jan
(94) |
Feb
(113) |
Mar
(77) |
Apr
(15) |
May
(79) |
Jun
(47) |
Jul
(49) |
Aug
(54) |
Sep
(93) |
Oct
(21) |
Nov
(46) |
Dec
(14) |
| 2010 |
Jan
(59) |
Feb
(30) |
Mar
(45) |
Apr
(38) |
May
(35) |
Jun
(53) |
Jul
(24) |
Aug
(194) |
Sep
(9) |
Oct
(49) |
Nov
(17) |
Dec
(25) |
| 2011 |
Jan
(25) |
Feb
(32) |
Mar
(9) |
Apr
(27) |
May
(46) |
Jun
(15) |
Jul
(30) |
Aug
(38) |
Sep
(66) |
Oct
(69) |
Nov
(39) |
Dec
(14) |
| 2012 |
Jan
(46) |
Feb
(31) |
Mar
(71) |
Apr
(87) |
May
(54) |
Jun
(37) |
Jul
(19) |
Aug
(7) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(4) |
| 2013 |
Jan
(58) |
Feb
(39) |
Mar
(13) |
Apr
(7) |
May
(6) |
Jun
(9) |
Jul
(2) |
Aug
(55) |
Sep
(54) |
Oct
(35) |
Nov
(16) |
Dec
(22) |
| 2014 |
Jan
(14) |
Feb
(15) |
Mar
(38) |
Apr
(33) |
May
(17) |
Jun
(22) |
Jul
(15) |
Aug
|
Sep
(9) |
Oct
(11) |
Nov
(23) |
Dec
(42) |
| 2015 |
Jan
(20) |
Feb
(10) |
Mar
(6) |
Apr
(3) |
May
(3) |
Jun
(29) |
Jul
(25) |
Aug
|
Sep
(5) |
Oct
(8) |
Nov
(8) |
Dec
(7) |
| 2016 |
Jan
(17) |
Feb
(26) |
Mar
(11) |
Apr
(9) |
May
(28) |
Jun
(17) |
Jul
(3) |
Aug
(7) |
Sep
(7) |
Oct
(4) |
Nov
(14) |
Dec
|
| 2017 |
Jan
(14) |
Feb
(18) |
Mar
(6) |
Apr
|
May
(2) |
Jun
(4) |
Jul
(5) |
Aug
(1) |
Sep
|
Oct
|
Nov
(14) |
Dec
(2) |
| 2018 |
Jan
(5) |
Feb
|
Mar
(10) |
Apr
(18) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(4) |
Nov
(2) |
Dec
(34) |
| 2019 |
Jan
(9) |
Feb
(11) |
Mar
(21) |
Apr
(2) |
May
(9) |
Jun
(5) |
Jul
(7) |
Aug
(1) |
Sep
(11) |
Oct
(8) |
Nov
(32) |
Dec
(14) |
| 2020 |
Jan
(7) |
Feb
(1) |
Mar
(2) |
Apr
(11) |
May
(12) |
Jun
(15) |
Jul
(17) |
Aug
(8) |
Sep
(11) |
Oct
|
Nov
(1) |
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
(1) |
May
(8) |
Jun
(15) |
Jul
(12) |
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
(12) |
| 2022 |
Jan
(6) |
Feb
(3) |
Mar
(18) |
Apr
(4) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(7) |
| 2023 |
Jan
|
Feb
|
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(7) |
Jul
(11) |
Aug
(4) |
Sep
(5) |
Oct
|
Nov
|
Dec
(17) |
| 2024 |
Jan
(10) |
Feb
(14) |
Mar
|
Apr
(3) |
May
(3) |
Jun
(19) |
Jul
(10) |
Aug
(9) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(27) |
Dec
(2) |
|
From: Uwe R. <Uwe...@ti...> - 2025-12-01 13:49:54
|
On 12/1/25 11:54 AM, David C. Partridge wrote: > I’m using QwtPlotSpectrogram with QwtMatrixRasterData to plot some > data that is quite large (about 9600 x 6400). The resolution of the image to be calculated depends on the resolutions of your plot canvas ( size * devicePixelRatio ) and your data: the smaller one is used. So the size of the matrix should not matter as long as the canvas resolution is below. To very what is going on have a look at the imageSize parameter of QwtPlotSpectrogram::renderImage. The rasterview example shows a situation, where the resolution of the data is below the one of the canvas. For NearestNeighbour the imageSize is here 4x4 as QwtMatrixRasterData does not provide more values. > Is there any way that you can change the code to use the > QFutureWatcher::finished signal to drive the repaint/update > **after** the time-consuming calculations are complete? The image composition is running over all pixels ( imageSize ) and requests a value from the raster data - probably downsampling in your situation. It divides the image into tiles filling each in its own thread. When using QwtMatrixRasterData the performance of QwtRasterData::value depends on the ResampleMode. As you are downsampling NearestNeighbour should be the right choice - what is a lookup in a QVector with some range checks. You could have a look at the spectrogram example where the time for the image composition is displayed on the status bar. When resizing the window you see the effect of the canvas size. The QwtRasterData::value implementation in the example is lighter than the one from QwtMatrixRasterData - but you see what to expect. HTH, Uwe |
|
From: David C. P. <dav...@pe...> - 2025-12-01 10:55:03
|
I'm using QwtPlotSpectrogram with QwtMatrixRasterData to plot some data that is quite large (about 9600 x 6400). When I invoke QwtPlot::replot() the Qt event processing is blocked for a long time. Is there any way that you can change the code to use the QFutureWatcher::finished signal to drive the repaint/update *after* the time-consuming calculations are complete? I tried to work out what I could change to achieve that, but I'm not familiar enough with the Qwt code to see where it would need to be changed. Thanks, David |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-24 10:36:55
|
Attach the rescaler after the first replot - otherwise it gets initialized with invalid scale intervals. HTH, Uwe |
|
From: David C. P. <dav...@pe...> - 2025-11-24 10:05:04
|
Hmm I added this to my class definition:
QwtPlotRescaler* rescaler{ nullptr };
and the following to the class ctor:
rescaler = new
QwtPlotRescaler(qualityPlot->canvas());
rescaler->setRescalePolicy(QwtPlotRescaler::Expanding);
rescaler->setAspectRatio(static_cast<double>(width) /
static_cast<double>(height));
and then in the code that populates the Spectrogram:
//
// Update the color map with
FWHM values from the interpolated grid
//
rasterData->setValueMatrix(QVector<double>(zgFWHM.cbegin(), zgFWHM.cend()),
static_cast<int>(xg.size()));
rescaler->rescale();
qualityPlot->replot();
but I get this odd result:
which clearly isn't as intended - what am I doing wrong?
Thanks
David
-----Original Message-----
From: David C. Partridge <dav...@pe...>
Sent: 24 November 2025 09:31
To: 'List for both Qwt users and developers'
<qwt...@li...>
Cc: 'Uwe Rathmann' <Uwe...@ti...>
Subject: RE: Ensuring aspect ratio is preserved in QwtPlotSpectrogram
> <https://qwt.sourceforge.io/class_qwt_plot_rescaler.html>
https://qwt.sourceforge.io/class_qwt_plot_rescaler.html
Many thanks
David
_______________________________________________
qwt-interest mailing list
<mailto:qwt...@li...>
qwt...@li...
<https://lists.sourceforge.net/lists/listinfo/qwt-interest>
https://lists.sourceforge.net/lists/listinfo/qwt-interest
|
|
From: David C. P. <dav...@pe...> - 2025-11-24 09:31:08
|
>https://qwt.sourceforge.io/class_qwt_plot_rescaler.html Many thanks David |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-24 05:12:26
|
On 11/22/25 5:09 PM, David C. Partridge wrote: > The data for which I am displaying the spectrogram is extracted from an > image that has an aspect ratio of 3:2 > > I want the spectrogram plot to display the plot with the spectrogram > having the same aspect ratio as the original image. https://qwt.sourceforge.io/class_qwt_plot_rescaler.html |
|
From: David C. P. <dav...@pe...> - 2025-11-22 16:09:38
|
The data for which I am displaying the spectrogram is extracted from an image that has an aspect ratio of 3:2 I want the spectrogram plot to display the plot with the spectrogram having the same aspect ratio as the original image. But it was stretched horizontally: I tried setting the major step size for both axes to 500, but that didn't quite work: Thanks, David |
|
From: David C. P. <dav...@pe...> - 2025-11-22 15:31:37
|
Thanks Uwe, I knew it had to be simple - I just couldn't work it out from the documentation. Thanks again, David |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-22 14:36:53
|
On 11/22/25 1:59 PM, David C. Partridge wrote:
> However, I want the Y axis to be inverted so 0 is at the top and 3500 at
> the bottom (and of course with the plot flipped vertically).
plot->setAxisScale( QwtPlot::yleft, 3500, 0 );
or when using the autoscaler:
plot_>axisScaleEngine( QwtPlot::yLeft )->setAttribute(
QwtScaleEngine::Inverted );
HTH,
Uwe
|
|
From: David C. P. <dav...@pe...> - 2025-11-22 13:13:01
|
I've managed to create spectrogram chart with interpolated data: However, I want the Y axis to be inverted so 0 is at the top and 3500 at the bottom (and of course with the plot flipped vertically). How can I do that please? Thank you, David |
|
From: David C. P. <dav...@pe...> - 2025-11-21 14:41:03
|
The code is not being built with "Treat warnings as errors" this is a Qt change to force these to be errors (previously they were warnings). -----Original Message----- From: Uwe Rathmann via qwt-interest <qwt...@li...> Sent: 21 November 2025 11:43 To: List for both Qwt users and developers <qwt...@li...> Cc: Uwe Rathmann <Uwe...@ti...> Subject: Re: Building against Qt 6.10.0 fails On 11/21/25 12:24 PM, David C. Partridge wrote: > 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(135,17): error C4996: > 'QDateTime::toTimeSpec': Use toTimeZone instead Should be warnings only - unless you have set your compiler options to fail on those warnings. So they should be no showstopper - nevertheless I will fix them. HTH, Uwe _______________________________________________ qwt-interest mailing list qwt...@li... https://lists.sourceforge.net/lists/listinfo/qwt-interest |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-21 11:43:06
|
On 11/21/25 12:24 PM, David C. Partridge wrote: > 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(135,17): error C4996: > 'QDateTime::toTimeSpec': Use toTimeZone instead Should be warnings only - unless you have set your compiler options to fail on those warnings. So they should be no showstopper - nevertheless I will fix them. HTH, Uwe |
|
From: David C. P. <dav...@pe...> - 2025-11-21 11:24:38
|
1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(135,17): error C4996: 'QDateTime::toTimeSpec': Use toTimeZone instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(160,17): error C4996: 'QDateTime::toTimeSpec': Use toTimeZone instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(178,13): error C4996: 'QDateTime::setTimeSpec': Use setTimeZone() instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(182,15): error C4996: 'QDateTime::toTimeSpec': Use toTimeZone instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(280,17): error C4996: 'QDateTime::QDateTime': Pass QTimeZone instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date.cpp(656,32): error C4996: 'QDateTime::QDateTime': Pass QTimeZone instead 1>qwt_dyngrid_layout.cpp 1>qwt_event_pattern.cpp 1>qwt_graphic.cpp 1>qwt_interval.cpp 1>qwt_interval_symbol.cpp 1>D:\Github\DSS\qwt-6.3.0\qwt_date_scale_draw.cpp(276,12): error C4996: 'QDateTime::setOffsetFromUtc': Use setTimeZone() instead 1>qwt_knob.cpp 1>qwt_legend.cpp 1>qwt_legend_data.cpp 1>qwt_legend_label.cpp 1>qwt_magnifier.cpp 1>qwt_math.cpp 1>qwt_matrix_raster_data.cpp 1>qwt_null_paintdevice.cpp 1>D:\Github\DSS\qwt-6.3.0\qwt_date_scale_engine.cpp(1119,12): error C4996: 'QDateTime::setOffsetFromUtc': Use setTimeZone() instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date_scale_engine.cpp(1281,12): error C4996: 'QDateTime::setOffsetFromUtc': Use setTimeZone() instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date_scale_engine.cpp(1306,23): error C4996: 'QDateTime::QDateTime': Pass QTimeZone instead 1>D:\Github\DSS\qwt-6.3.0\qwt_date_scale_engine.cpp(1313,12): error C4996: 'QDateTime::setOffsetFromUtc': Use setTimeZone() instead 1>qwt_painter.cpp |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-17 06:04:59
|
On 11/14/25 7:12 PM, Uwe Rathmann via qwt-interest wrote: > The implemented interpolation modes > ( QwtMatrixRasterData::ResampleMode ) are for situations where the > resolution of the data is below the resolution of the output device. So for example, when having an area of 1000x1000 and you pass a 10x10 matrix with valid values: the resolution of the data would be below ( each data pixel covers 100x100 ) and you can f.e enable QwtMatrixData::BilinearInterpolation. In case the valid pixels of the sparse data are equidistant this could be done. HTH, Uwe |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-14 18:12:56
|
On 11/14/25 6:15 PM, David C. Partridge wrote: > I want to create a contour plot from the data that I do have. Qwt does not invent any values - it is displaying what is given. And a NaN value is interpreted as a gap ( areas where you don't have values ). The implemented interpolation modes ( QwtMatrixRasterData::ResampleMode ) are for situations where the resolution of the data is below the resolution of the output device. In Qwt the term "contour" is used like in matlab: https:// www.mathworks.com/help/matlab/ref/contour.html. Not what your posted screenshot showed. > There was a post by David Stranz from Sierra Analytics about using > Gaussian "splatting" with Qwt to interpolate non-uninform/sparse > data with QwtPlotSpectrogram on the QtCentre forum, but > unfortunately the code he posted there doesn't compile with Qwt > 6.3.0. This should be an operation on your input matrix - not sure why this has to be dependent on Qwt. Why not using the algo and passing the result to QwtPlotSpecrogram ? Uwe |
|
From: David C. P. <dav...@pe...> - 2025-11-14 14:48:44
|
I have no idea what your question means. The data is the size I told you. One pixel on the plot at its default size will be minute (smaller that a screen pixel as it is mapped from the data array which is large to a small screen area. So, a data point can be anywhere in that 5202x3464 area (so I guess that's the bounding rectangle) or are you asking what the default QwtPlot rectangle is? If so that's about 740x500 -----Original Message----- From: Uwe Rathmann via qwt-interest <qwt...@li...> Sent: 14 November 2025 11:48 To: qwt...@li... Cc: Uwe Rathmann <Uwe...@ti...> Subject: Re: Sparse data for contour plot On 11/14/25 12:42 PM, David C. Partridge wrote: > I want the data interpolated (ignoring the Nan values). The actual > display window is relatively small but can be enlarged. Please answer my question: what is the bounding rectangle of the data and what is the size of one pixel - in plot coordinates ? Uwe _______________________________________________ qwt-interest mailing list qwt...@li... https://lists.sourceforge.net/lists/listinfo/qwt-interest |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-14 11:48:27
|
On 11/14/25 12:42 PM, David C. Partridge wrote: > I want the data interpolated (ignoring the Nan values). The actual > display window is relatively small but can be enlarged. Please answer my question: what is the bounding rectangle of the data and what is the size of one pixel - in plot coordinates ? Uwe |
|
From: David C. P. <dav...@pe...> - 2025-11-14 11:42:27
|
I want the data interpolated (ignoring the Nan values). The actual display window is relatively small but can be enlarged. D. -----Original Message----- From: Uwe Rathmann via qwt-interest <qwt...@li...> Sent: 14 November 2025 10:18 To: List for both Qwt users and developers <qwt...@li...> Cc: Uwe Rathmann <Uwe...@ti...> Subject: Re: Sparse data for contour plot On 11/14/25 10:06 AM, David C. Partridge wrote: > That size is the size of the image from which the data comes and valuesToPlot is therefore 5202x3464 in size. You have to think in terms of plot coordinates - the boundaries of axes. So your spectrogram shows data from [0-5202] and [0-3464]. But what is the size ( in plot coordinates ) of the area that is covered by a valid value ? Uwe _______________________________________________ qwt-interest mailing list qwt...@li... https://lists.sourceforge.net/lists/listinfo/qwt-interest |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-14 10:18:31
|
On 11/14/25 10:06 AM, David C. Partridge wrote: > That size is the size of the image from which the data comes and valuesToPlot is therefore 5202x3464 in size. You have to think in terms of plot coordinates - the boundaries of axes. So your spectrogram shows data from [0-5202] and [0-3464]. But what is the size ( in plot coordinates ) of the area that is covered by a valid value ? Uwe |
|
From: David C. P. <dav...@pe...> - 2025-11-14 09:06:54
|
That size is the size of the image from which the data comes and valuesToPlot is therefore 5202x3464 in size. So, the value of the second parameter in the call: rasterData->setValueMatrix(valuesToPlot, lightFrameInfo.m_lHeight); is 3464. I didn't know I could control the pixel size of the actual data points on the drawing canvas so I assume that ATM they are 1 pixel in size. David -----Original Message----- From: Uwe Rathmann via qwt-interest <qwt...@li...> Sent: 13 November 2025 18:45 To: List for both Qwt users and developers <qwt...@li...> Cc: Uwe Rathmann <Uwe...@ti...> Subject: Re: Sparse data for contour plot > I’m trying to produce a contour plot of some data. The data is > sparse in a matrix that is 5202 x 3464, I have around 100 data points. What is 5202x3464 -the size of your plot canvas ? And what number of pixels do you want to set for each value ? Uwe _______________________________________________ qwt-interest mailing list qwt...@li... https://lists.sourceforge.net/lists/listinfo/qwt-interest |
|
From: Uwe R. <Uwe...@ti...> - 2025-11-13 18:45:35
|
> I’m trying to produce a contour plot of some data. The data is sparse > in a matrix that is 5202 x 3464, I have around 100 data points. What is 5202x3464 -the size of your plot canvas ? And what number of pixels do you want to set for each value ? Uwe |
|
From: David C. P. <dav...@pe...> - 2025-11-13 17:51:40
|
What I’m hoping to get is something like this which was produced by IDL’s CONTOUR routine from very similar data:
From: David C. Partridge <dav...@pe...>
Sent: 13 November 2025 17:13
To: 'List for both Qwt users and developers' <qwt...@li...>
Subject: Sparse data for contour plot
I’m trying to produce a contour plot of some data. The data is sparse in a matrix that is 5202 x 3464, I have around 100 data points.
I set a QVector up filled with NaNs, and then fill in the actual data values I have.
I set the intervals for the X and Y axis in the ctor:
rasterData->setInterval(Qt::XAxis, QwtInterval(0, lightFrameInfo.m_lWidth));
rasterData->setInterval(Qt::YAxis, QwtInterval(0, lightFrameInfo.m_lHeight));
I then display the plot:
//
// Clear the raster data
//
valuesToPlot.clear();
valuesToPlot.resize(lightFrameInfo.m_lWidth * lightFrameInfo.m_lHeight, std::numeric_limits<double>::quiet_NaN());
rasterData->setValueMatrix(valuesToPlot, lightFrameInfo.m_lHeight);
auto p = std::minmax_element(fwhmValues.cbegin(), fwhmValues.cend());
qDebug() << "FWHM Min:" << *p.first << " Max:" << *p.second;
rasterData->setInterval(Qt::ZAxis, QwtInterval(0, *p.second));
//
// Update the raster data with the actual FWHM values that we have
//
for (uint32_t i = 0; i < lightFrameInfo.m_vStars.size(); ++i)
{
rasterData->setValue(static_cast<int>(xValues[i]), static_cast<int>(yValues[i]), fwhmValues[i]);
}
spectrogram->setData(rasterData);
spectrogram->setDisplayMode(QwtPlotSpectrogram::ContourMode, true);
const QwtInterval zInterval = spectrogram->data()->interval(Qt::ZAxis);
contourPlot->setAxisScale(QwtPlot::yRight, zInterval.minValue(), zInterval.maxValue());
contourPlot->replot();
Unfortunately, I don’t appear to get a contour plot, but just a dark plot (for all the NaNs) with a few single pixel dots for the actual data points I have.
I also don’t seem to get an axis scale on the right.
Clearly, I’m not doing this right ☹.
Help much appreciated.
Cheers, David
<https://github.com/sponsors/deepskystacker?o=esb> Please click here to support DeepSkyStacker development
|
|
From: David C. P. <dav...@pe...> - 2025-11-13 17:12:59
|
I’m trying to produce a contour plot of some data. The data is sparse in a matrix that is 5202 x 3464, I have around 100 data points.
I set a QVector up filled with NaNs, and then fill in the actual data values I have.
I set the intervals for the X and Y axis in the ctor:
rasterData->setInterval(Qt::XAxis, QwtInterval(0, lightFrameInfo.m_lWidth));
rasterData->setInterval(Qt::YAxis, QwtInterval(0, lightFrameInfo.m_lHeight));
I then display the plot:
//
// Clear the raster data
//
valuesToPlot.clear();
valuesToPlot.resize(lightFrameInfo.m_lWidth * lightFrameInfo.m_lHeight, std::numeric_limits<double>::quiet_NaN());
rasterData->setValueMatrix(valuesToPlot, lightFrameInfo.m_lHeight);
auto p = std::minmax_element(fwhmValues.cbegin(), fwhmValues.cend());
qDebug() << "FWHM Min:" << *p.first << " Max:" << *p.second;
rasterData->setInterval(Qt::ZAxis, QwtInterval(0, *p.second));
//
// Update the raster data with the actual FWHM values that we have
//
for (uint32_t i = 0; i < lightFrameInfo.m_vStars.size(); ++i)
{
rasterData->setValue(static_cast<int>(xValues[i]), static_cast<int>(yValues[i]), fwhmValues[i]);
}
spectrogram->setData(rasterData);
spectrogram->setDisplayMode(QwtPlotSpectrogram::ContourMode, true);
const QwtInterval zInterval = spectrogram->data()->interval(Qt::ZAxis);
contourPlot->setAxisScale(QwtPlot::yRight, zInterval.minValue(), zInterval.maxValue());
contourPlot->replot();
Unfortunately, I don’t appear to get a contour plot, but just a dark plot (for all the NaNs) with a few single pixel dots for the actual data points I have.
I also don’t seem to get an axis scale on the right.
Clearly, I’m not doing this right ☹.
Help much appreciated.
Cheers, David
Please click here to support DeepSkyStacker development <https://github.com/sponsors/deepskystacker?o=esb>
|
|
From: David C. P. <dav...@pe...> - 2025-11-13 14:01:11
|
1>D:\Github\DSS\qwt-6.3.0\qwt_polar_layout.cpp(351,9): warning C4146: unary
minus operator applied to unsigned type, result still unsigned
1>D:\Github\DSS\qwt-6.3.0\qwt_polar_layout.cpp(351,26): warning C4146: unary
minus operator applied to unsigned type, result still unsigned
Looking at that bit of code, I think it probably should read:
rect.adjust( m_data->margin, m_data->margin,
- static_cast<qreal>(m_data->margin), -
static_cast<qreal>(m_data->margin) );
HtH
David
|
|
From: David C. P. <dav...@pe...> - 2025-11-13 13:30:43
|
Ah! That's an interesting way of doing it. How do I persuade Qt VS Tools to not compile the moc files (are they all included by the cpp files)? David -----Original Message----- From: Uwe Rathmann via qwt-interest <qwt...@li...> Sent: 13 November 2025 12:38 To: List for both Qwt users and developers <qwt...@li...> Cc: Uwe Rathmann <Uwe...@ti...> Subject: Re: Problems building qwt using Visual Studio (not qmake) On 11/13/25 12:56 PM, David C. Partridge wrote: > I’ve created a Visual Studio project to build qwt as a static library > as part of my solution. The build is mostly working but it is > breaking down when compiling the moc output. When looking at the end of qwt_plot_picker.cpp you will see: #include "moc_qwt_plot_picker.cpp" So the moc file is nothing you do not have to compile - its code is compiled together with the cpp file. cmake or qmake do have specific rules for includes that start with moc_ ( Q_OBJECT in .h ) or .moc ( Q_OBJECT in cpp file ). Obviously your setup does not follow these rules. The reason for including the moc files are: - faster builds ( only one unit per file ) - forward declarations of property classes in the header HTH, Uwe _______________________________________________ qwt-interest mailing list qwt...@li... https://lists.sourceforge.net/lists/listinfo/qwt-interest |