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
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
invert_sign(num)
¶
Change sign of number or add/remove leading sign of str.
Source code in src/prettypyplot/tools.py
45 46 47 48 49 50 51 52 53 54 55 | |
parse_axes(*args, ax)
¶
Extract axes from ax, args or returns args and current axes.
Source code in src/prettypyplot/tools.py
58 59 60 61 62 63 64 65 66 67 68 | |
gca(ax)
¶
Return ax if it is axes instance, else the current active axes.
Source code in src/prettypyplot/tools.py
71 72 73 74 75 | |
get_axes(axs)
¶
Return axs if it is all axes instances, else the all current axes.
Source code in src/prettypyplot/tools.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
is_discrete_cmap(cmap)
¶
Return if cmap is discrete or continuos.
Source code in src/prettypyplot/tools.py
94 95 96 | |