### plotting the results of a pythermoigs simulation
It is expected that the user knows how to plot using matplotlib and xarrays, such that they can make plots of the inputs and outputs to suit their needs.
That being said, a plotting function is provided which will produce a plot of a results DataSet, provided it either:
- has dimensions = ["p_value"] and processes more than 1 p_value
- has dimensions = ["p_value", "x", "y"], in which case the results will be plotted as maps
Check out the definition of `plot_doublet_performance_results` for more details.
This will make plots of the results, with two modes;
1. If the results DataSet has a dimension of [p_value] line plots of all variables with p_value as the x-axis will be made
2. If he dimensions are [p_value, x, y] then maps of all variables will be made with the variables along the row of the plot and p_value along the column
if no outfile is provided the plots will be shown using plt.show()
:param title:
:param outfile:
:param results:
:return:
"""
dims=list(results.dims)
ifdims==['p_value']andlen(results.p_value)>1:
plot_maps=False
elifset(dims)=={'p_value','x','y'}:
plot_maps=True
else:
raiseTypeError(f"Results Dataset has dims: {results.dims}.plot_doublet_performance_results() only accepts:\n1. a results DataSet with dims=[p_value] (where their is more than 1 p_value)\n2. or dims=[p_value, x, y]\nInstead, write a custom plotting function for your dataset.")
Given a results DataSet with the dimensions of p_value (and *only* p_value) then make a plot of every variable in that results dataset varying as a function of p_value
Given a results DataSet with the dimensions of p_value, x, y then make a map plot of every variable in that results dataset with variables changing per-row and p_value changing per-column
:param results:
:param outfile:
:param title:
:return:
"""
n_variables=len(results.variables)-3# don't plot the p_value, x or y variables