midgard.plot

midgard.plot.matplotlib_extension

Matplotlib extension library

Description:

Wrapper functions around matplotlib subroutines are defined in this library.

get_statistic()

Full name: midgard.plot.matplotlib_extension.get_statistic

Signature: (data:numpy.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()

Full name: midgard.plot.matplotlib_extension.plot

Signature: (x_arrays:List[numpy.ndarray], y_arrays:List[numpy.ndarray], xlabel:str='', ylabel:str='', x_unit:str='', y_unit:str='', colors:Union[List[str], NoneType]=None, labels:Union[List[str], NoneType]=None, figure_path:str='plot_scatter.png', opt_args:Dict[str, Any]={}, events:Union[Dict[str, List[Any]], NoneType]=None) -> None

Generate scatter/plot plot

Several scatter/plot plots can be plotted on one plot. This is defined via the chosen number of y_arrays data. Histogram is only plotted for the last given y-array in "y_arrays".

Following opt_arg options can be selected:

Option Value Description
colormap Color map type for plotting either events or labels (e.g. viridis, jet,
tab10, rainbow, hsv, plasma)
dpi Resolution of file in dots per inch
figsize (num, num) Figure size given by (width, height) in inches
fsize_subtitle Fontsize of subplot title (statistical information)
grid <True False>
histogram Plot x-axis histogram on top, y-axis histogram on right or for both
axis on scatter plot
histogram_binwidth Histogram bin width
histogram_size Histogram y-axis size
legend <True False>
legend_location Legend location
legend_ncol The number of legend columns
linestyle