Remove bug for the calculation of colorbar-range

This commit is contained in:
Gabriel Wolf 2018-09-20 12:11:46 +01:00
parent e0246c86bd
commit 6fc5c36a95

View File

@ -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))