mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
#13282 Histogram Plots: Add option for Logarithmic axis scale
Fixes #13282.
This commit is contained in:
1 parent
75371d3471
commit
d00d3f20b1
4 files changed
+20
-1
No files matched your search
@@ -102,6 +102,7 @@ void RimHistogramMultiPlot::insertPlot( RimPlot* plot, size_t index )
|
||||
CVF_ASSERT( sumPlot != nullptr );
|
||||
if ( sumPlot )
|
||||
{
|
||||
sumPlot->axisChanged.connect( this, &RimHistogramMultiPlot::onSubPlotAxisChanged );
|
||||
sumPlot->curvesChanged.connect( this, &RimHistogramMultiPlot::onSubPlotChanged );
|
||||
sumPlot->titleChanged.connect( this, &RimHistogramMultiPlot::onSubPlotChanged );
|
||||
sumPlot->autoTitleChanged.connect( this, &RimHistogramMultiPlot::onSubPlotAutoTitleChanged );
|
||||
@@ -543,6 +544,14 @@ void RimHistogramMultiPlot::onSubPlotChanged( const caf::SignalEmitter* emitter
|
||||
applyPlotWindowTitleToWidgets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimHistogramMultiPlot::onSubPlotAxisChanged( const caf::SignalEmitter* emitter, RimHistogramPlot* summaryPlot )
|
||||
{
|
||||
syncAxisRanges();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -108,6 +108,7 @@ private:
|
||||
void appendCurveByStepping( int direction );
|
||||
|
||||
void onSubPlotChanged( const caf::SignalEmitter* emitter );
|
||||
void onSubPlotAxisChanged( const caf::SignalEmitter* emitter, RimHistogramPlot* summaryPlot );
|
||||
void onSubPlotAutoTitleChanged( const caf::SignalEmitter* emitter, bool isEnabled );
|
||||
|
||||
std::pair<double, double> adjustedMinMax( const RimPlotAxisProperties* axis, double min, double max ) const;
|
||||
|
||||
@@ -429,11 +429,20 @@ void RimHistogramPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisPr
|
||||
}
|
||||
else
|
||||
{
|
||||
plotWidget()->setAxisScaleType( plotAxis, RiuQwtPlotWidget::AxisScaleType::LINEAR );
|
||||
plotWidget()->setAxisAutoScale( axisProperties->plotAxis(), true );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( axisProperties->isLogarithmicScaleEnabled() )
|
||||
{
|
||||
plotWidget()->setAxisScaleType( plotAxis, RiuQwtPlotWidget::AxisScaleType::LOGARITHMIC );
|
||||
}
|
||||
else
|
||||
{
|
||||
plotWidget()->setAxisScaleType( plotAxis, RiuQwtPlotWidget::AxisScaleType::LINEAR );
|
||||
}
|
||||
double min = axisProperties->visibleRangeMin();
|
||||
double max = axisProperties->visibleRangeMax();
|
||||
if ( axisProperties->isAxisInverted() ) std::swap( min, max );
|
||||
|
||||
Reference in new issue
Block a user