This commit is contained in:
2019-07-05 08:54:50 +02:00
parent c582ba15d5
commit 8ac7d96ef3
7 changed files with 42 additions and 60 deletions

View File

@ -4,7 +4,7 @@
* @version 1.0
*/
#include "ansi.h"
#include <iostream>
#include <cmath>
#include "SlsQt2DHist.h"
@ -89,8 +89,8 @@ void SlsQt2DHist::SetData(int nbinsx, double xmin, double xmax, int nbinsy,doubl
}
void SlsQt2DHist::SetMinMax(double zmin,double zmax){
cprintf(GREEN, "zmin:%f zmax:%f\n", zmin, zmax);
if(zmin<zmax){
/* if(zmin<zmax){ edited out to test*/
if(zmax != -1){
z_min=zmin;
z_max=zmax;
}else{

View File

@ -3,7 +3,7 @@
* @author Ian Johnson
* @version 1.0
*/
#include "ansi.h"
#include <cmath>
#include <iostream>
#include <qlist.h>
@ -235,34 +235,19 @@ void SlsQt2DPlot::Update() {
const QwtInterval zInterval = d_spectrogram->data()->interval(Qt::ZAxis);
rightAxis->setColorMap(zInterval, myColourMap(isLog));
#endif
if (!zoomer->zoomRectIndex())
UnZoom();
#if QWT_VERSION < 0x060000
setAxisScale(QwtPlot::yRight, d_spectrogram->data().range().minValue(),
d_spectrogram->data().range().maxValue());
#else
//cprintf(MAGENTA, "zmin:%f zmax:%f\n", zInterval.minValue(), zInterval.maxValue());
setAxisScale(QwtPlot::yRight, zInterval.minValue(), zInterval.maxValue());
#ifdef VERYVERBOSE
std::cout << "axis scale set\n";
#endif
plotLayout()->setAlignCanvasToScales(true);
#ifdef VERYVERBOSE
std::cout << "layout\n";
#endif
#endif
#ifdef VERYVERBOSE
std::cout << "going to replot\n";
#endif
replot();
#ifdef VERYVERBOSE
std::cout << "done\n";
#endif
}
void SlsQt2DPlot::showContour(bool on) {

View File

@ -2,7 +2,7 @@
#include "logger.h"
#include <iostream>
#include "ansi.h"
#include <qtoolbutton.h>
#include <qgroupbox.h>
#include <qgridlayout.h>
@ -84,12 +84,10 @@ void SlsQt2DPlotLayout::UpdateZRange(double min, double max) {
if(isLog) {
the_plot->SetZMinimumToFirstGreaterThanZero();
}
cprintf(BLUE, "zmin:%f zmax:%f\n", zmin, zmax);
// set zmin and zmax
if (isZmin || isZmax) {
zmin = (isZmin ? min : the_plot->GetZMinimum());
zmax = (isZmax ? max : the_plot->GetZMaximum());
cprintf(RED, "zmin:%f zmax:%f\n", zmin, zmax);
// if it is the same values, we should reset it to plots min and max (not doing this now: not foolproof now)
// setting the range of values possible in the dispZMin and dispZMax (not doin this now: not foolproof)
the_plot->SetZMinMax(zmin, zmax);
@ -97,7 +95,6 @@ cprintf(BLUE, "zmin:%f zmax:%f\n", zmin, zmax);
zmin = 0;
zmax = -1;
}
the_plot->Update();
}