tools
This module contains utility functions used in multiple submodules.
is_number(number, *, dtype=float)
¶
Check if argument can be interpreated as number.
Parameters:
-
number
((string, float, int)
) –Variable to be check if it can be casted to float.
-
dtype
(dtype
, default:float
) –Check for different dtypes, so if is float or if it is int.
Returns:
-
is_number
(bool
) –Return if argument can be casted to float.
Source code in src/prettypyplot/tools.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
invert_sign(num)
¶
Change sign of number or add/remove leading sign of str.
Source code in src/prettypyplot/tools.py
35 36 37 38 39 40 41 42 43 44 45 46 |
|
parse_axes(*args, ax)
¶
Extract axes from ax, args or returns args and current axes.
Source code in src/prettypyplot/tools.py
49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
gca(ax)
¶
Return ax if it is axes instance, else the current active axes.
Source code in src/prettypyplot/tools.py
64 65 66 67 68 |
|
get_axes(axs)
¶
Return axs if it is all axes instances, else the all current axes.
Source code in src/prettypyplot/tools.py
71 72 73 74 75 76 77 78 79 80 81 82 |
|
is_discrete_cmap(cmap)
¶
Return if cmap is discrete or continuos.
Source code in src/prettypyplot/tools.py
85 86 87 |
|