mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8961 Auto scale factor : Do not use scale factor for some value ranges
This commit is contained in:
parent
5e53f5687d
commit
a28cecd19b
@ -467,6 +467,20 @@ void RimPlotAxisProperties::computeAndSetScaleFactor()
|
||||
{
|
||||
auto maxAbsValue = std::max( std::fabs( visibleRangeMax() ), std::fabs( visibleRangeMin() ) );
|
||||
|
||||
if ( maxAbsValue < 1.0 && maxAbsValue > 1e-6 )
|
||||
{
|
||||
// Do not use scale factor for small values above 1e-6
|
||||
scaleFactor = 1.0;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( maxAbsValue > 1.0 && maxAbsValue < 1e6 )
|
||||
{
|
||||
// Do not use scale factor for values above 1 and below 1e-6
|
||||
scaleFactor = 1.0;
|
||||
return;
|
||||
}
|
||||
|
||||
int exponent = std::floor( std::log10( maxAbsValue ) );
|
||||
if ( exponent > 0 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user