mass.visualization
Contains function for visualizing simulation results.
This module contains the various functions for visualization of solutions
returned in MassSolutions after simulation of models.
In general, it is recommended to pass an matplotlib.axes.Axes instance
into the visualization function in order to guaruntee more control over the
generated plot and ensure that the plot be placed onto a figure as expected.
If an Axes is not passed into the function, then the
currrent axes instance will be used, accessed via:
matplotlib.pyplot.gca()
All functions will return the axes instance utilzed in generating the plot.
The legend input format for the plotting function must be one of the
following:
An iterable of legend labels as strings (e.g.
legend=["A", "B", ...]).A
strrepresenting the location of the legend, or anintbetween 0 and 14 (inclusive) corresponding to the legend location (e.g.legend="best"orlegend=1).An iterable of the format
(labels, loc)to set both the legend labels and location, where thelabelsandlocin the iterable follows the formats specified above in both 1 and 2, respectively. (e.g.legend=(["A", "B", ...], "best"))
Valid legend location strings and the integer corresponding to the legend location codes are the following:
Location String (str)
Location Code (int)
‘best’
0
‘upper right’
1
‘upper left’
2
‘lower left’
3
‘lower right’
4
‘right’
5
‘center left’
6
‘center right’
7
‘lower center’
8
‘upper center’
9
‘center’
10
‘upper right outside’
11
‘upper left outside’
12
‘lower left outside’
13
‘lower right outside’
14
‘right outside’
15
‘left outside’
16
‘lower outside’
17
‘upper outside’
18
Some other important things to note about the legend include the following:
Note that the last four “outside” locations are NOT
matplotlib.legendlocation values, but rather they utilize the legend kwargbbox_to_anchorto place the legend outside of the plot.If only legend labels are provided (i.e. format specified above in 1), the default legend location specified in the
matplotlib.rcsetupwill be used.If only the legend location is provided (i.e. format specified above in 2), the corresponding keys in
mass_solutionwill be used as default legend labels.If invalid input is provided (e.g. too many legend labels provided, invalid legend location), a warning will be issued and the default values will be used.
See the
matplotlib.legenddocumentation for additional control over the plot legend.
The following are optional kwargs that can be passed to the functions
of the visualiation module.
- time_vector :
iterableof values to treat as time points for the solutions. If provided, the original solutions in theMassSolutioninput will be converted into interpolating functions and the solutions are recalculated based on the providedtime_vector. IfNonethen the currenttimevalues will be used.Default is
None.- plot_function :
strrepresenting the plotting function to use. Accepted values are the following:For all functions:
"plot"for a linear x-axis and a linear y-axis viaAxes.plot()
"loglog"for a logarithmic x-axis and a logarithmic y-axis viaAxes.loglog()In addition, for functions in
time_profilesandphase_portraitssubmodules only:
"semilogx” for a logarithmic x-axis and a linear y-axis viaAxes.semilogx()
"semilogy"for a linear x-axis and a logarithmic y-axis viaAxes.semilogy()Default is
"plot".- title :
Either a
strto set as the title or atupleof length 2 where the first value is the title string and the second value is adictof font options. Arguments are passed to the corresponding setter methodAxes.set_title().Default is
None.- xlabel :
Either a
strto set as the xlabel or atupleof length 2 where the first value is the xlabel string and the second value is adictof font options. Arguments are passed to the corresponding setter methodAxes.set_xlabel().Default is
None. Not valid forplot_tiled_phase_portraits()- ylabel :
Either a
strto set as the ylabel or atupleof length 2 where the first value is the ylabel string and the second value is adictof font options. Arguments are passed to the corresponding setter methodAxes.set_ylabel().Default is
None. Not valid forplot_tiled_phase_portraits()- xlim :
tupleof form(xmin, xmax)containing numerical values specifying the limits of the x-axis. Passed to the corresponding setter methodAxes.set_xlim(). Forplot_tiled_phase_portraits(), the limits will be applied to all tiles containing phase portrait plots.Default is
None.- ylim :
tupleof form(ymin, ymax)containing numerical values specifying the limits of the y-axis. Passed to the corresponding setter methodAxes.set_ylim(). Forplot_tiled_phase_portraits(), the limits will be applied to all tiles containing phase portrait plots.Default is
None.- xmargin :
floatvalue greater than -0.5 to set as the padding for the x-axis data limits prior to autoscaling. Passed to the corresponding setter methodAxes.set_xmargin(). Forplot_tiled_phase_portraits(), the margins will be applied to all tiles containing phase portrait plots.Default is
0.15forplot_tiled_phase_portraits(), otherwiseNone.- ymargin :
floatvalue greater than -0.5 to set as the padding for the y-axis data limits prior to autoscaling. Passed to the corresponding setter methodAxes.set_ymargin(). Forplot_tiled_phase_portraits(), the margins will be applied to all tiles containing phase portrait plots.Default is
0.15forplot_tiled_phase_portraits(), otherwiseNone.- color :
Value or
iterableof values representing validmatplotlib.colorsvalues to use as line colors. If a single color is provided, that color will be applied to all solutions being plotted. If aniterableof color values is provided, it must be equal to the number of solutions to be plotted. Forplot_tiled_phase_portraits(), the colors will be applied to all tiles containing phase portrait plots.Default is
None. Ignored if the kwargprop_cycleris also provided.- linestyle :
Value or
iterableof values representing validmatplotliblinestyles. If a single linestyle is provided, that linestyle will be applied to all solutions being plotted. If aniterableis provided, it must be equal to the number of solutions to be plotted. Forplot_tiled_phase_portraits(), the linestyles will be applied to all tiles containing phase portrait plots.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwargprop_cycleris also provided.- linewidth :
floatvalue representing the linewidth (in points) to set.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwargprop_cycleris also provided.- marker :
Value or
iterableof values representing valudmatplotlibmarker values to use as line markers. If a single marker is provided, that marker will be applied to all solutions being plotted. If aniterableis provided, it must be equal to the number of solutions to be plotted. Forplot_tiled_phase_portraits(), the markers will be applied to all tiles containing phase portrait plots.For functions in
comparision, default is"o", otherwise default isNoneto use default value inmatplotlib.rcsetup. Ignored if the kwargprop_cycleris also provided.- markersize :
floatvalue representing the size of the marker (in points) to set. Forplot_tiled_phase_portraits(), the markersizes will be applied to all tiles containing phase portrait plots. Ignored if the kwargprop_cycleris also provided.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwargprop_cycleris also provided.- grid :
Either a
boolor atupleof form(which, axis)where the values forwhichandaxisare one of the following:
whicharguement must be"major","minor", or"both"
axisargument must be"x","y", or"both"If
grid=Falsethen grid lines will be removed. Ifgrid=True, then grid lines will be created based on the default values inmatplotlib.rcsetupunless overridden bygrid_color,grid_linestyle, orgrid_linewidthkwargs. Passed to the setter methodAxes.grid(). Forplot_tiled_phase_portraits(), the grid lines will be applied to all tiles containing phase portrait plots.Default is
None.- grid_color :
Value representing a valid
matplotlib.colorsvalue to use as the color of the grid lines. Forplot_tiled_phase_portraits(), the color of the grid lines will be applied to all tiles containing phase portrait plots.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwarggridisNone.- grid_linestyle :
Value representing a valid
matplotlibvalue to use as the linestyles of the grid lines. Forplot_tiled_phase_portraits(), the linestyle of the grid lines will be applied to all tiles containing phase portrait plots.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwarggridisNone.- grid_linewidth :
floatvalue representing the grid linewidth (in points) to set.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwarggridisNone.- legend_ncol :
intindicating the number of columns to use in the legend. IfNonethe the following formula is applied:ncols = int(ceil(sqrt(N_total) / 3))where
N_totalis equal to the total number of solution lines.Default is
None. Not valid forplot_tiled_phase_portraits()- deviation :
boolindicating whether to plot the deviation from the initial value for the observable variables.Default is
False.- deviation_zero_centered :
boolindicating whether to center deviations around zero for for the observable variables.Default is
False. Ignored if the kwargdeviation=False.- deviation_normalization :
strindicating how to normalize the plotted deviation values. Can be one of the following:
‘initial’ to normalize the solution by dividing by the initial value of the solution variable
‘range’ to normalize the solution through dividing by the range of solution values (maximum value - minimum value)
Default is
initial. Ignored if the kwargdeviation=False.- annotate_time_points :
Either the string
"endpoints"or aniterablecontaining the numerical values for the time points of interest to be annotated by plotting points for the solutions at the given time points. Ifannotate_time_points="endpoints"then only the initial and final time points will be utilized. IfNonethen no time points will be annotated. Forplot_tiled_phase_portraits(), the time points will be applied to all tiles containing phase portrait plots.Default is
None.- annotate_time_points_color :
Value or
iterableof values representing validmatplotlib.colorsvalues to use as time point colors. If a single color is provided, that color will be applied to all time points being plotted. If aniterableof color values is provided, it must be equal to the number of time points to be plotted. Forplot_tiled_phase_portraits(), the colors will be applied to all tiles containing phase portrait plots.Default is
None.- annotate_time_points_marker :
Value or
iterableof values representing valudmatplotlibmarker values to use as time point markers. If a single marker is provided, that marker will be applied to all solutions being plotted. If aniterableis provided, it must be equal to the number of time points to be plotted. Forplot_tiled_phase_portraits(), the markers will be applied to all tiles containing phase portrait plots.Default is
None.- annotate_time_points_markersize :
floatvalue representing the size of the marker (in points) to set. Forplot_tiled_phase_portraits(), the markersizes will be applied to all tiles containing phase portrait plots.Default is
Noneto use default value inmatplotlib.rcsetup.- annotate_time_points_labels :
boolindicating whether to annotate the time points with their labels on the plot itself.Default is
False.- annotate_time_points_legend :
A
strrepresenting the location of the legend, or anintbetween 0 and 14 (inclusive) corresponding to the location to use for the legend of annotated time points. Cannot be the same location value as the plot’slegendlocation. IfNone, no legend is created.Default is
None.- prop_cycle :
A valid
matplotlib.rcsetup.cycler()instance to use in the plot. If provided, then thecolor,linestyle,linewidth,marker, andmarkersizekwargs are ignored.Default is
None.- mean_line_alpha :
floatindicating the alpha (opacity) value to use for the line representing the mean solution.Default is
1.0. Only valid for ensemble visualization functions.- interval_fill_alpha :
floatindicating the alpha (opacity) value to use in shading the interval.Default is
0.5. Only valid for ensemble visualization functions.- interval_border_alpha :
floatindicating the alpha (opacity) value for border lines of the interval.Default is
0.5. Only valid for ensemble visualization functions.- CI_distribution :
Either
"t"to calculate the confidence interval using a t-distribution or"z"to calculate the confidence interval using a z-distribution.Default is
"t". Only valid for ensemble visualization functions.- tile_ticks_on :
boolindicating whether to leave tick marks on tiles containing phase portraits.Default is
False. Only valid forplot_tiled_phase_portraits().- tile_xlabel_fontdict :
Font propertiesto set using adict. Applied to all tile ylabels.Default is
None. Only valid forplot_tiled_phase_portraits().- tile_ylabel_fontdict :
Font propertiesto set using adict. Applied to all tile ylabels.Default is
None. Only valid forplot_tiled_phase_portraits().- data_tile_fontsize :
Valid
fontsizevalue representing the fontsize to be used for the data values on tiles displaying additional data.Default is
large. Only valid forplot_tiled_phase_portraits(). Ignored if no additional data is provided (i.e.additional_data=None).- data_tile_color :
Value representing a valid
matplotlib.colorsvalue to use as the facecolor of the tiles displaying additional data.Default is
Noneto utilize the color"lightgray". Only valid forplot_tiled_phase_portraits(). Ignored if no additional data is provided (i.e.additional_data=None).- diag_tile_color :
Value representing a valid
matplotlib.colorsvalue to use as the facecolor of the tiles on the diagonal.Default is
Noneto utilize the color"black". Only valid forplot_tiled_phase_portraits().- empty_tile_color :
Value representing a valid
matplotlib.colorsvalue to use as the facecolor of the empty tiles.Default is
Noneto utilize the color"white". Only valid forplot_tiled_phase_portraits().- xy_line :
Whether to plot a line with equation
y=x. Ifxy_line=True, then the line will be created based on the default values inmatplotlib.rcsetupunless overridden byxy_linecolor,xy_linestyle, orxy_linewidthkwargs.Ignored if the kwarg
xy_line=False. Only valid for functions in thecomparisonsubmodule.- xy_linecolor :
Value representing a valid
matplotlib.colorsvalue to use as the color of they=xline.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwargxy_line=False. Only valid for functions in thecomparisonsubmodule.- xy_linestyle :
Value representing a valid
matplotlibvalue to use as the style of they=xline.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwargxy_line=False. Only valid for functions in thecomparisonsubmodule.- xy_linewidth :
floatvalue representing the linewidth (in points) to set for they=xline.Default is
Noneto use default value inmatplotlib.rcsetup. Ignored if the kwargxy_line=False. Only valid for functions in thecomparisonsubmodule.- xy_legend :
strindicating where to place a legend for they=xline.Default is
None. Ignored if the kwargxy_line=False. Only valid for functions in thecomparisonsubmodule.
Submodules
Package Contents
Functions
|
Plot values of two objects for comparision. |
|
Plot a phase portrait for an ensemble of class:~.MassSolution objects. |
|
Plot phase portraits of solutions in a given |
|
Plot phase portraits of solutions in a given |
|
Plot time profiles for an ensemble of class:~.MassSolution objects. |
|
Plot time profiles of solutions in a given |
- mass.visualization.plot_comparison(x, y, compare=None, observable=None, ax=None, legend=None, **kwargs)[source]
Plot values of two objects for comparision.
This function can take two
MassModel,ConcSolution,cobra.Solution, orpandas.Seriesobjects and plot them against one another in a calibration plot.Accepted
kwargsare passed onto variousmatplotlibmethods utilized in the function. See thevisualizationmodule documentation for more detailed information about the possiblekwargs.Notes
If a
pandas.Series, the index must correspond to the identifier of the assoicated object. (e.g. a metabolite identifier forcompare="concentrations", or a reaction identifier forcompare="Keqs")
- Parameters
x (MassModel, ConcSolution, Solution, Series) – The object to access for x-axis values.
y (MassModel, ConcSolution, Solution, Series) – The object to access for y-axis values.
compare (str) –
The values to be compared. Must be one of the following:
"concentrations"forMassModelandConcSolutionobjects."Keqs"forMassModelandConcSolutionobjects."fluxes"forMassModelandcobra.Solutionobjects."kfs"forMassModelobjects.
Not required if both
xandyarepandas.Series.observable (iterable) – An iterable containing string identifiers of
massobjects or the objects themselves corresponding to the object or index where the value is located.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 labels specified in 1 and 2.
See the
visualizationdocumentation for more information about legend and valid legend locations.**kwargs –
plot_function
title
xlabel
ylabel
xlim
ylim
grid
grid_color
grid_linestyle
grid_linewidth
prop_cycle
color
marker
markersize
legend_ncol
xy_line
xy_linecolor
xy_linewidth
xy_linestyle
xy_legend
See
visualizationdocumentation for more information on optionalkwargs.
- Returns
ax – The
Axesinstance containing the newly created plot.- Return type
- mass.visualization.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.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.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
- mass.visualization.plot_ensemble_time_profile(mass_solution_list, observable, ax=None, legend=None, interval_type=None, **kwargs)[source]
Plot time profiles 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.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.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 labels specified in 1 and 2.
See the
visualizationdocumentation for more information about legend and valid legend locations.interval_type (str, None) –
The type of interval to display with the plotted mean of the solution. Can be one of the following:
"range": Interval shading occurs from the minimum to the maximum value for each time point."CI=": Interval shading occurs for a confidence interval. (e.g. confidence interval of 95% is specified as"CI=95.0".)Noneto prevent interval shading from occurring.
Default is
None**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
mean_line_alpha
interval_fill_alpha
interval_border_alpha
CI_distribution
See
visualizationdocumentation for more information on optionalkwargs.
- Returns
ax – The
Axesinstance containing the newly created plot.- Return type
- mass.visualization.plot_time_profile(mass_solution, observable=None, ax=None, legend=None, **kwargs)[source]
Plot time profiles 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.observable (iterable, None) – An iterable containing string identifiers of the
massobjects or the objects themselves that correspond to the keys for the desired solutions in theMassSolution. IfNonethen all solutions are plotted.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 labels 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
annotate_time_points_zorder
deviation
deviation_zero_centered
deviation_normalization
See
visualizationdocumentation for more information on optionalkwargs.
- Returns
ax – The
Axesinstance containing the newly created plot.- Return type