midgard.plot
midgard.plot.matplotlib_extension
get_statistic()
Full name: midgard.plot.matplotlib_extension.get_statistic
Signature: (data:'ndarray', funcs:List[str]=['rms', 'mean', 'std', 'min', 'max', 'percentile'], unit:str='') -> List[str]
Get text string with statistical information
List of statistical functions (funcs), which can be chosen:
Function | Description |
---|---|
max | Maximal value of data array |
min | Minimal value of data array |
mean | Mean value of data array |
percentile | 95th percentile of data array |
rms | Root mean square of data array |
std | Standard deviation of data array |
Args: data: Array with data. funcs: List with statistical choices
Returns:
List with strings representing statistical information
plot_scatter_subplot_row()
Full name: midgard.plot.matplotlib_extension.plot_scatter_subplot_row
Signature: (ax:'AxesSubplot', x_array:'ndarray', y_array:'ndarray', xlabel:str='', ylabel:str='', x_unit:str='', y_unit:str='', label:str='', color:Union[NoneType, _ForwardRef('ndarray')]=None, opt_args:Union[Dict[str, Any], NoneType]=None) -> None
Generate single row of scatter subplot
Example:
Following options can be selected:
Option | Value | Description |
---|---|---|
alpha | Blending values of markers (0: transparent, 1: opaque) | |
fsize_subtitle | Fontsize of subplot title (statistical information) | |
marker | <'.' | '-'> |
markersize | Marker size | |
reg_line | <True | False> |
statistic | Plot statistical information. Following function can be defined: 'max', | |
'mean', 'min', 'rms', 'std', 'percentile' (see function get_statistic for | ||
more information) |
Args:
ax: Axes object needed for plotting subplot row. x_array: Array with x-axis data to plot. y_array: Array with y-axis data to plot. xlabel: X-axis label. ylabels: X-axis label. x_unit: X-axis unit. y_unit: Y-axis unit. label: Legend label. color: Marker color. opt_args: Dictionary with options, which overwrite default plot configuration.
plot_scatter_subplots()
Full name: midgard.plot.matplotlib_extension.plot_scatter_subplots
Signature: (x_array:'ndarray', y_arrays:List[_ForwardRef('ndarray')], xlabel:str, ylabels:List[str], x_unit:str='', y_unit:str='', figure_path:str='plot_scatter_subplot.png', opt_args:Union[Dict[str, Any], NoneType]=None, events:Union[Tuple[Any, str, str], NoneType]=None) -> None
Generate scatter subplot
The subplot has only one column. The number of rows is defined via the chosen number of y-axis data.
Example:
Following opt_arg options can be selected:
Option | Value | Description |
---|---|---|
dpi | Resolution of file in dots per inch | |
figsize | (num, num) | Figure size |
fsize_subtitle | Fontsize of subplot title (statistical information) | |
marker | <'.' | '-'> |
plot_to | <console | file> |
reg_line | <True | False> |
sharex | <True | False> |
sharey | <True | False> |
statistic | Plot statistical information. Following function can be defined: 'max', | |
'mean', 'min', 'rms', 'std', 'percentile' (see function _get_statistic for | ||
more information) | ||
title | Main title of subplots |
Args:
x_array: Array with x-axis data to plot. y_arrays: List of arrays with y-axis data to plot. xlabel: X-axis label. ylabels: List with y-axis labels. It should corresponds to given number of y-axis arrays. x_unit: X-axis unit. y_unit: Y-axis unit. figure_path: Figure path. opt_args: Dictionary with options, which overwrite default plot configuration.