uf3.util.plotting.round_lims¶
- round_lims(values, round_factor=0.5)[source]¶
- Identify rounded minimum and maximum based on appropriate power of 10
and round_factor.
round_place = 10 ** ceil( log10((max-min))-1 ) Minimum = (floor(min / round_place / round_factor)
round_place * round_factor)
- Maximum = (ceil(max / round_place / round_factor)
round_place * round_factor)
- E.g. [10, 39, 43] yields (10, 50) with round_factor = 1 (nearest 10)
[10, 39, 43] yields (0, 100) with round_factor = 10 (nearest 100) [10, 39, 43] yields (0, 45) with round_factor = 0.5 (nearest 5)
- Parameters
values (np.ndarray, list) – vector of values of interest.
round_factor (float) – multiplicative factor for rounding power (Default = 0.5).
- Returns
tuple of (rounded minimum, rounded maximum)
- Return type
lims