mass.visualization.phase_portraits
Contains function for visualizing phase portraits of simulation results.
See the mass.visualization documentation for general information
on mass.visualization functions.
This module contains the following functions for visualization of
time-dependent solutions returned in MassSolutions after
simulation of models.
plot_tiled_phase_portrait()
Module Contents
Functions
|
Plot phase portraits of solutions in a given |
|
Plot a phase portrait for an ensemble of class:~.MassSolution objects. |
|
Plot phase portraits of solutions in a given |
|
Get default |
- mass.visualization.phase_portraits.plot_phase_portrait(mass_solution, x, y, ax=None, legend=None, **kwargs)[source]
Plot phase portraits of solutions in a given
MassSolution.Accepted
kwargsare passed onto variousmatplotlibmethods utilized in the function. See thevisualizationmodule documentation for more detailed information about the possiblekwargs.Notes
To prevent any changes to the original
MassSolution, a copy of theMassSolutionis created and used.
- Parameters
mass_solution (MassSolution) – The
MassSolutioncontaining the time-dependent solutions to be plotted.x (
massobject or its string identifier) – The string identifier of amassobject or the object itself that corresponds to the key for the desired solution in theMassSolutionfor the x-axis of the phase portrait.y (
massobject or its string identifier) – The string identifier of amassobject or the object itself that corresponds to the key for the desired solution in theMassSolutionfor the y-axis of the phase portrait.ax (matplotlib.axes.Axes, None) – An
Axesinstance to plot the data on. IfNonethen the current axes instance is used.There are three possible input formats for the legend:
An iterable of legend labels as strings.
A
strrepresenting the location of the legend, or anintbetween 0 and 14 (inclusive) corresponding to the legend location.An iterable of the format
(labels, loc)to set both the legend labels and location, wherelabelsandlocfollows the format specified in 1 and 2.
See the
visualizationdocumentation for more information about legend and valid legend locations.**kwargs –
time_vector
plot_function
title
xlabel
ylabel
xlim
ylim
grid
grid_color
grid_linestyle
grid_linewidth
prop_cycle
color
linestyle
linewidth
marker
markersize
legend_ncol
annotate_time_points
annotate_time_points_color
annotate_time_points_marker
annotate_time_points_markersize
annotate_time_points_labels
annotate_time_points_legend
deviation
deviation_zero_centered
deviation_normalization
See
visualizationdocumentation for more information on optionalkwargs.
- Returns
ax – The
Axesinstance containing the newly created plot.- Return type
- mass.visualization.phase_portraits.plot_ensemble_phase_portrait(mass_solution_list, x, y, ax=None, legend=None, **kwargs)[source]
Plot a phase portrait for an ensemble of class:~.MassSolution objects.
The plotted lines represent the mean for the values of a particular solution specified in
observable.Accepted
kwargsare passed onto variousmatplotlibmethods utilized in the function. See thevisualizationmodule documentation for more detailed information about the possiblekwargs.Notes
To prevent any changes to the original
MassSolution, copies ofMassSolutionobjects are created and used.
- Parameters
mass_solution_list (iterable) – An iterable of
MassSolutionobjects containing the time-dependent solutions to be plotted.x (
massobject or its string identifier) – The string identifier of amassobject or the object itself that corresponds to the key for the desired solution in theMassSolutionfor the x-axis of the phase portrait.y (
massobject or its string identifier) – The string identifier of amassobject or the object itself that corresponds to the key for the desired solution in theMassSolutionfor the y-axis of the phase portrait.ax (matplotlib.axes.Axes, None) – An
Axesinstance to plot the data on. IfNonethen the current axes instance is used.There are three possible input formats for the legend:
An iterable of legend labels as strings.
A
strrepresenting the location of the legend, or anintbetween 0 and 14 (inclusive) corresponding to the legend location.An iterable of the format
(labels, loc)to set both the legend labels and location, wherelabelsandlocfollows the format specified in 1 and 2.
See the
visualizationdocumentation for more information about legend and valid legend locations.**kwargs –
time_vector
plot_function
title
xlabel
ylabel
xlim
ylim
grid
grid_color
grid_linestyle
grid_linewidth
prop_cycle
color
linestyle
linewidth
marker
markersize
legend_ncol
annotate_time_points
annotate_time_points_color
annotate_time_points_marker
annotate_time_points_markersize
annotate_time_points_labels
annotate_time_points_legend
deviation
deviation_zero_centered
deviation_normalization
See
visualizationdocumentation for more information on optionalkwargs.
- Returns
ax – The
Axesinstance containing the newly created plot.- Return type
- mass.visualization.phase_portraits.plot_tiled_phase_portraits(mass_solution, observable=None, ax=None, plot_tile_placement='all', additional_data=None, **kwargs)[source]
Plot phase portraits of solutions in a given
MassSolution.Accepted
kwargsare passed onto various matplotlib methods in utilized in the function. See thevisualizationmodule documentation for more detailed information about the possiblekwargs.Notes
To prevent any changes to the original
MassSolution, a copy of theMassSolutionwill be created and used.iandjrepresent the number of rows and columns, respectively.
- Parameters
mass_solution (MassSolution) – The
MassSolutioncontaining the time-dependent solutions to be plotted.observable (iterable) – An iterable containing string identifiers of the
massobjects or the objects themselves that correspond to the keys for the desired solutions in theMassSolution.ax (matplotlib.axes.Axes, None) – An
Axesinstance to plot the data on. IfNonethen the current axes instance is used.plot_tile_placement (str) –
A string representing the location to place the tiles containing phase portrait plots. Must be one of the following:
"lower"to place plot tiles on the lower left triangular section(i < j)on the figure tiles."upper"to place plot tiles on the upper right triangular section(i > j)on the figure tiles.allto place plot tiles on the lower left triangular section(i < j)AND on the upper right triangular section(i > j)on the figure tiles.
additional_data (array_like, None) – A matrix of shape
(N, N)whereN_obsis the number of observables provided, or the number of keys in theMassSolutionifobservable=None. The value at(i, j)of the matrix must correspond to the empty tile that the data should be displayed on. All other values are ignored. IfNonethen no data will be displayed and tiles will be left empty.**kwargs –
time_vector
plot_function
title
xlim
ylim
grid
grid_color
grid_linestyle
grid_linewidth
prop_cycle
color
linestyle
linewidth
marker
markersize
annotate_time_points
annotate_time_points_color
annotate_time_points_marker
annotate_time_points_markersize
annotate_time_points_legend
annotate_time_points_zorder
tile_ticks_on
tile_xlabel_fontdict
tile_ylabel_fontdict
data_tile_fontsize
data_tile_color
diag_tile_color
empty_tile_color
See
visualizationdocumentation for more information on optionalkwargs.
- Returns
ax – The
Axesinstance containing the newly created plot.- Return type