Remove bug for the calculation of colorbar-range
This commit is contained in:
parent
e0246c86bd
commit
6fc5c36a95
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user