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
|
import numpy as np
|
||||||
from math import floor
|
from math import floor
|
||||||
# round values
|
# round values
|
||||||
if abs(cbar_max) > abs(cbar_min):
|
fac = floor(np.log10(abs(cbar_max-cbar_min)))
|
||||||
fac = floor(np.log10(abs(cbar_max)))
|
#if abs(cbar_max) > abs(cbar_min):
|
||||||
else:
|
# fac = floor(np.log10(abs(cbar_max)))
|
||||||
fac = floor(np.log10(abs(cbar_min)))
|
#else:
|
||||||
|
# fac = floor(np.log10(abs(cbar_min)))
|
||||||
fac = fac-1
|
fac = fac-1
|
||||||
cbar_max = round(cbar_max,-int(fac))
|
cbar_max = round(cbar_max,-int(fac))
|
||||||
cbar_min = round(cbar_min,-int(fac))
|
cbar_min = round(cbar_min,-int(fac))
|
||||||
|
Loading…
Reference in New Issue
Block a user