From 6fc5c36a959b7da7cdf95ce713fad864ed74c7f8 Mon Sep 17 00:00:00 2001 From: Gabriel Wolf Date: Thu, 20 Sep 2018 12:11:46 +0100 Subject: [PATCH] Remove bug for the calculation of colorbar-range --- myplot_inputs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/myplot_inputs.py b/myplot_inputs.py index ec279d7..d010446 100644 --- a/myplot_inputs.py +++ b/myplot_inputs.py @@ -94,10 +94,11 @@ def myplot_create_cbar(cbar_min, cbar_max, num=[]): import numpy as np from math import floor # round values - if abs(cbar_max) > abs(cbar_min): - fac = floor(np.log10(abs(cbar_max))) - else: - fac = floor(np.log10(abs(cbar_min))) + fac = floor(np.log10(abs(cbar_max-cbar_min))) + #if abs(cbar_max) > abs(cbar_min): + # fac = floor(np.log10(abs(cbar_max))) + #else: + # fac = floor(np.log10(abs(cbar_min))) fac = fac-1 cbar_max = round(cbar_max,-int(fac)) cbar_min = round(cbar_min,-int(fac))