---
title: "SystemModelPlot"
language: "en"
type: "Symbol"
summary: "SystemModelPlot[sim] shows default plots from the SystemModelSimulationData object sim. SystemModelPlot[sim, id] shows model plot with identifier or name  id. SystemModelPlot[sim, {v1, v2, ...}] generates a plot of the variables vi in sim. SystemModelPlot[{sim1, sim2, ...}, ...] plots variables from several simulations. SystemModelPlot[model, ...] plots from a new simulation of  model."
keywords: 
- modelica
- plot
- modelica plot
- simulation plot
- variable plot
- simulation compare
- simulation comparison
- mathmodelica
- simulation results
- simulation visualization
- SystemModeler
- SystemModeler link
canonical_url: "https://reference.wolfram.com/language/ref/SystemModelPlot.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "System Model Analytics & Design"
    link: "https://reference.wolfram.com/language/guide/SystemModelAnalyticsDesign.en.md"
  - 
    title: "System Modeling Overview"
    link: "https://reference.wolfram.com/language/guide/SystemModelingOverview.en.md"
  - 
    title: "System Model Simulation"
    link: "https://reference.wolfram.com/language/guide/SystemModelSimulation.en.md"
  - 
    title: "Systems Modeling"
    link: "https://reference.wolfram.com/language/guide/SystemsModeling.en.md"
  - 
    title: "Life Sciences & Medicine: Data & Computation"
    link: "https://reference.wolfram.com/language/guide/LifeSciencesAndMedicineDataAndComputation.en.md"
related_functions: 
  - 
    title: "SystemModelSimulationData"
    link: "https://reference.wolfram.com/language/ref/SystemModelSimulationData.en.md"
  - 
    title: "SystemModelSimulate"
    link: "https://reference.wolfram.com/language/ref/SystemModelSimulate.en.md"
  - 
    title: "SystemModelSimulateSensitivity"
    link: "https://reference.wolfram.com/language/ref/SystemModelSimulateSensitivity.en.md"
  - 
    title: "SystemModelUncertaintyPlot"
    link: "https://reference.wolfram.com/language/ref/SystemModelUncertaintyPlot.en.md"
  - 
    title: "Plot"
    link: "https://reference.wolfram.com/language/ref/Plot.en.md"
  - 
    title: "ParametricPlot"
    link: "https://reference.wolfram.com/language/ref/ParametricPlot.en.md"
  - 
    title: "SystemModel"
    link: "https://reference.wolfram.com/language/ref/SystemModel.en.md"
  - 
    title: "SystemModelExamples"
    link: "https://reference.wolfram.com/language/ref/SystemModelExamples.en.md"
related_tutorials: 
  - 
    title: "Getting Started with Model Simulation and Analysis"
    link: "https://reference.wolfram.com/language/tutorial/GettingStartedWithModelSimulationAndAnalysis.en.md"
---
[EXPERIMENTAL]

# SystemModelPlot

SystemModelPlot[sim] shows default plots from the SystemModelSimulationData object sim.

SystemModelPlot[sim, "id"] shows model plot with identifier or name "id".

SystemModelPlot[sim, {v1, v2, …}] generates a plot of the variables vi in sim.

SystemModelPlot[{sim1, sim2, …}, …] plots variables from several simulations. 

SystemModelPlot[model, …] plots from a new simulation of "model".

## Details and Options

* ``SystemModelPlot`` is used to plot data produced by simulating system models.

* The ``model`` can have the following forms:

|                             |                             |
| --------------------------- | --------------------------- |
| SystemModel[…]              | general system model        |
| StateSpaceModel[…]          | state-space model           |
| TransferFunctionModel[…]    | transfer function model     |
| AffineStateSpaceModel[…]    | affine state-space model    |
| NonlinearStateSpaceModel[…] | nonlinear state-space model |
| DiscreteInputOutputModel[…] | discrete input-output model |

* Plot specifications detail the names and definitions available in simulations and models. Using ``sim["Plots"]`` and ``sim["PlotNames"]`` allows one to discover these.

* Possible values for ``"id"`` include:

|                |                                          |
| -------------- | ---------------------------------------- |
| "identifier"   | plot or subplot identifier               |
| "name"         | plot name                                |
| "group / name" | plot group and a plot name joined by "/" |
| "group"        | plot group                               |
| "variable"     | variable name                            |

* The first match for ``"id"`` will be the one used.

* ``SystemModelPlot[…, {tmin, tmax}]`` plots from ``tmin`` to ``tmax``.

* ``SystemModelPlot[{model, args}, …]`` generates simulation data using ``SystemModelSimulate[model, args]``.

* ``SystemModelPlot[sim, {{v1, p1, d1}, …}, …]`` plots variables ``vi`` and sensitivity bounds when parameter ``pi`` varies ``100di%``. »

* ``SystemModelPlot`` has the same options as ``ListLinePlot``, with the following additions and changes: []

|                    |                     |                                     |
| ------------------ | ------------------- | ----------------------------------- |
| AxesLabel          | Automatic           | indicate units on axis              |
| Mesh               | None                | mesh points to draw on each line    |
| PlotLegends        | Automatic           | use variable names vi               |
| ProgressReporting  | \$ProgressReporting | control display of progress         |
| ScalingFunctions   | Automatic           | how to scale individual coordinates |
| TargetUnits        | Automatic           | plot in display units from model    |

* Events in a simulation are indicated in a plot with ``Mesh -> Events``. »

* Possible settings for ``TargetUnits`` include:

|                         |                                         |
| ----------------------- | --------------------------------------- |
| "DisplayUnit"           | display units converted to common units |
| "IndividualDisplayUnit" | display units without conversion        |
| "Unit"                  | base units converted to common units    |
| "IndividualUnit"        | base units without conversion           |
| unity                   | explicit y unit                         |
| {unitx, unity}          | units for x and y                       |

* ``"Unit"`` and ``"DisplayUnit"`` attempt to convert compatible quantities to a common unit.

* ``"DisplayUnit"`` and ``"IndividualDisplayUnit"`` convert to a unit specified in the model for plot purposes.

* Models with ``"Epoch"`` in their simulation settings trigger the use of ``DateScale``.

### List of all options

|                        |                     |                                                                                    |
| ---------------------- | ------------------- | ---------------------------------------------------------------------------------- |
| AlignmentPoint         | Center              | the default point in the graphic to align with                                     |
| AspectRatio            | 1 / GoldenRatio     | ratio of height to width                                                           |
| Axes                   | True                | whether to draw axes                                                               |
| AxesLabel              | Automatic           | indicate units on axis                                                             |
| AxesOrigin             | Automatic           | where axes should cross                                                            |
| AxesStyle              | {}                  | style specifications for the axes                                                  |
| Background             | None                | background color for the plot                                                      |
| BaselinePosition       | Automatic           | how to align with a surrounding text baseline                                      |
| BaseStyle              | {}                  | base style specifications for the graphic                                          |
| ClippingStyle          | None                | what to draw when lines are clipped                                                |
| ColorFunction          | Automatic           | how to determine the coloring of lines                                             |
| ColorFunctionScaling   | True                | whether to scale arguments to ColorFunction                                        |
| ContentSelectable      | Automatic           | whether to allow contents to be selected                                           |
| CoordinatesToolOptions | Automatic           | detailed behavior of the coordinates tool                                          |
| DataRange              | Automatic           | the range of x values to assume for data                                           |
| Epilog                 | {}                  | primitives rendered after the main plot                                            |
| Filling                | None                | filling under each line                                                            |
| FillingStyle           | Automatic           | style to use for filling                                                           |
| FormatType             | TraditionalForm     | the default format type for text                                                   |
| Frame                  | False               | whether to put a frame around the plot                                             |
| FrameLabel             | None                | frame labels                                                                       |
| FrameStyle             | {}                  | style specifications for the frame                                                 |
| FrameTicks             | Automatic           | frame ticks                                                                        |
| FrameTicksStyle        | {}                  | style specifications for frame ticks                                               |
| GridLines              | None                | grid lines to draw                                                                 |
| GridLinesStyle         | {}                  | style specifications for grid lines                                                |
| ImageMargins           | 0.                  | the margins to leave around the graphic                                            |
| ImagePadding           | All                 | what extra padding to allow for labels etc.                                        |
| ImageSize              | Automatic           | the absolute size at which to render the graphic                                   |
| InterpolationOrder     | None                | the polynomial degree of curves used in joining data points                        |
| IntervalMarkers        | Automatic           | how to render uncertainty                                                          |
| IntervalMarkersStyle   | Automatic           | style for uncertainty elements                                                     |
| LabelingFunction       | Automatic           | how to label points                                                                |
| LabelingSize           | Automatic           | maximum size of callouts and labels                                                |
| LabelStyle             | {}                  | style specifications for labels                                                    |
| MaxPlotPoints          | Infinity            | the maximum number of points to include                                            |
| Mesh                   | None                | mesh points to draw on each line                                                   |
| MeshFunctions          | {#1&}               | how to determine the placement of mesh points                                      |
| MeshShading            | None                | how to shade regions between mesh points                                           |
| MeshStyle              | Automatic           | the style for mesh points                                                          |
| Method                 | Automatic           | methods to use                                                                     |
| MultiaxisArrangement   | None                | how to arrange multiple axes for data                                              |
| PerformanceGoal        | \$PerformanceGoal   | aspects of performance to try to optimize                                          |
| PlotHighlighting       | Automatic           | highlighting effect for points                                                     |
| PlotLabel              | None                | overall label for the plot                                                         |
| PlotLabels             | None                | labels for data                                                                    |
| PlotLayout             | "Overlaid"          | how to position data                                                               |
| PlotLegends            | Automatic           | use variable names vi                                                              |
| PlotMarkers            | None                | markers to use to indicate each point                                              |
| PlotRange              | Automatic           | range of values to include                                                         |
| PlotRangeClipping      | True                | whether to clip at the plot range                                                  |
| PlotRangePadding       | Automatic           | how much to pad the range of values                                                |
| PlotRegion             | Automatic           | the final display region to be filled                                              |
| PlotStyle              | Automatic           | graphics directives to determine the style of each line                            |
| PlotTheme              | \$PlotTheme         | overall theme for the plot                                                         |
| PreserveImageOptions   | Automatic           | whether to preserve image options when displaying new versions of the same graphic |
| ProgressReporting      | \$ProgressReporting | control display of progress                                                        |
| Prolog                 | {}                  | primitives rendered before the main plot                                           |
| RotateLabel            | True                | whether to rotate y labels on the frame                                            |
| ScalingFunctions       | Automatic           | how to scale individual coordinates                                                |
| TargetUnits            | Automatic           | plot in display units from model                                                   |
| Ticks                  | Automatic           | axes ticks                                                                         |
| TicksStyle             | {}                  | style specifications for axes ticks                                                |

---

## Examples (57)

### Basic Examples (3)

Plot a default model plot from a model simulation:

```wl
In[1]:= SystemModelPlot[[image]]

Out[1]= [image]
```

---

Plot a model plot from a model simulation:

```wl
In[1]:= SystemModelPlot[[image], "PositionsX"]

Out[1]= [image]
```

---

Choose one of the example models from the [analog electrical domain](http://reference.wolfram.com/system-modeler/libraries/Modelica/Modelica.Electrical.Analog.Examples.html) :

```wl
In[1]:= model = First[SystemModelExamples["Models", "Modelica.Electrical.Analog.*"]]

Out[1]= [image]
```

Show the model plot:

```wl
In[2]:= SystemModelPlot[model]

Out[2]= [image]
```

### Scope (27)

#### Models (4)

Plot a default model plot from a ``SystemModel`` :

```wl
In[1]:= SystemModelPlot[[image]]

Out[1]= [image]
```

---

Plot a variable from the simulation of an ``AffineStateSpaceModel`` :

```wl
In[1]:=
SystemModelPlot[AffineStateSpaceModel[{{Cos[x2], Rational[-1, 10]*x2 - 
    Cos[x1^2]}, {{0}, {1}}, {x2}, {{0}}}, 
 {x1, x2}, Automatic, {Automatic}, Automatic, SamplingPeriod -> None], {x2}]

Out[1]= [image]
```

---

Plot all variables from the simulation of a ``NonlinearStateSpaceModel`` :

```wl
In[1]:=
SystemModelPlot[NonlinearStateSpaceModel[{{Cos[x] + 4*Sin[Rational[1, 2]*x]}, 
  {x + Sin[x]}}, {x}, {}, {Automatic}, Automatic, 
 SamplingPeriod -> None], All]

Out[1]= [image]
```

---

Simulate a ``DiscreteInputOutputModel`` :

```wl
In[1]:=
diom = DiscreteInputOutputModel[Association["SampledSeries" -> TemporalData[TimeSeries, 
    {{{{u[0], u[0]}, {u[0] - u[1], u[0] + u[1]}, {u[0] - u[1] - u[2], u[0] + u[1] + u[2]}}}, 
     {{0, 2, 1}}, 1, {"Discrete", 1}, {"Discrete", 1}, 2, {MissingDataMe ... ime", "LastValue", "OutputCount", "OutputVariables", "Path", 
  "PathComponent", "PathComponents", "PathFunction", "PathLength", "SamplingPeriod", "StateCount", 
  "TemporalData", "TimePath", "Times", "TimeSeries", "TimeValues", "Type", "Values"}];

In[2]:= sim = SystemModelSimulate[diom, <|"Inputs" -> {1 -> Range[-50, 50]}|>]

Out[2]=
SystemModelSimulationData[Association[Subscript[\[FormalY], 1] -> TemporalData[TimeSeries, 
    {CompressedData["«243»"], {{0, 100, 1}}, 1, 
     {"Discrete", 1}, {"Discrete", 1}, 1, 
     {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 0}, Val ... imensions -> 1}}, 
      False, 14.3]]], Hold[{}], Hold[{}], Hold[{u}], Hold[{Subscript[\[FormalY], 1], Subscript[\[FormalY], 2]}], 
 Hold[{}], Association["InputVariables" -> Association[], "OutputVariables" -> Association[], 
  "StateVariables" -> Association[]]]
```

Plot all simulation results:

```wl
In[3]:= SystemModelPlot[sim, All]

Out[3]= [image]
```

#### Variable Specification (2)

Plot variables from a model simulation:

```wl
In[1]:= SystemModelPlot[[image], {"x1", "x2", "x3", "x4", "x5"}]

Out[1]= [image]
```

---

Show bounds when varying a parameter:

```wl
In[1]:= sim = SystemModelSimulateSensitivity[[image], 5, {"sineVoltage1.f"}];
```

Show the estimated capacitor voltage variation when varying the frequency by 5%:

```wl
In[2]:= SystemModelPlot[sim, {{"capacitor1.v", "sineVoltage1.f", 0.05}}]

Out[2]= [image]
```

#### Time Specification (3)

Simulate a model for 10 seconds:

```wl
In[1]:= sim = SystemModelSimulate[[image], 10];
```

Plot the variable ``x1`` for the whole interval:

```wl
In[2]:= SystemModelPlot[sim, {"x1"}]

Out[2]= [image]
```

---

If no interval argument is given, the whole simulation interval is plotted:

```wl
In[1]:= sim = SystemModelSimulate[[image], {0, 10}];

In[2]:= SystemModelPlot[sim, {"x1", "x2"}]

Out[2]= [image]
```

Plot only a certain interval:

```wl
In[3]:= SystemModelPlot[sim, {"x1", "x2"}, {0, 2}]

Out[3]= [image]
```

---

Models with ``"Epoch"`` in their simulation settings are plotted as values at a sequence of dates:

```wl
In[1]:= model = SystemModel[[image], <|"ModelName" -> "MyModel", "SimulationSettings" -> {"Epoch" -> Now}|>]

Out[1]= [image]
```

Plot the model:

```wl
In[2]:= SystemModelPlot[model, {"CSTR1.T", "CSTR1.Tc"}, Quantity[20, "Minutes"]]

Out[2]= [image]
```

#### Simulation Specification (4)

Simulate and plot a model from ``0`` to ``5`` :

```wl
In[1]:= SystemModelPlot[[image], {"x1", "x2"}, 5]

Out[1]= [image]
```

---

Different simulations can be compared in the same plot:

```wl
In[1]:= {Subscript[sim, 1], Subscript[sim, 2]} = SystemModelSimulate[[image], <|"InitialValues" -> {"angle1" -> {(π/4), (π/3)}}|>];
```

The plot legends are prepended with the simulation number:

```wl
In[2]:= SystemModelPlot[{Subscript[sim, 1], Subscript[sim, 2]}, {"angle1"}]

Out[2]= [image]
```

---

Simulate a model with given initial values and plot the result:

```wl
In[1]:= SystemModelPlot[[image], {"angle1", "angle2", "angle4", "angle5"}, 10, <|"InitialValues" -> {"angle1" -> π / 3, "angle2" -> 3π / 12}|>]

Out[1]= [image]
```

---

Simulate an oscillating mass on a spring, with a damper acting on the spring:

```wl
In[1]:= sim = SystemModelSimulate[[image], 2, <|"ParameterValues" -> {"spring2.c" -> 100, "damper1.d" -> {1, 3, 10}}|>];
```

Compare the oscillation of the mass with the different levels of damping:

```wl
In[2]:= SystemModelPlot[sim, {"mass2.s"}]

Out[2]= [image]
```

#### Model Plots (4)

Models can have defined plots:

```wl
In[1]:= sim = SystemModelSimulate[[image]];
```

Get names of the model plots:

```wl
In[2]:= plotNames = sim["PlotNames"]

Out[2]= {"Trajectory in the xy plane", "Trajectory in the yz plane", "Trajectory in the xz plane"}
```

Show a model plot:

```wl
In[3]:= SystemModelPlot[sim, First[plotNames], Axes -> False, Frame -> True, AspectRatio -> 1]

Out[3]= [image]
```

---

Find the model plot identifiers:

```wl
In[1]:= ids = Query[All, "Identifier"]@SystemModel[[image], "Plots"]

Out[1]= {"9d779", "a351a", "991d9"}
```

Show a model plot using its identifier:

```wl
In[2]:= SystemModelPlot[[image], First[ids]]

Out[2]= [image]
```

---

Model plots may contain multiple subplots:

```wl
In[1]:= sim = SystemModelSimulate[[image]];
```

Show a model plot:

```wl
In[2]:= SystemModelPlot[sim, First[sim["PlotNames"]]]

Out[2]= [image]
```

---

Model plots may contain groupings of plots:

```wl
In[1]:= sim = SystemModelSimulate[[image]];
```

Groups are indicated by the `` / `` separator:

```wl
In[2]:= sim["PlotNames"]

Out[2]= {"PositionsX", "PositionsY", "PositionsParametric", "VelocitiesParametric", "Angles/Values", "Angles/Derivatives"}
```

All plots in a group can be plotted at once:

```wl
In[3]:= SystemModelPlot[sim, "Angles", PlotRange -> All]

Out[3]= [image]
```

#### Presentation (10)

Multiple variables are automatically colored to be distinct:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= SystemModelPlot[sim, {"x1", "x2", "x3", "x4", "x5"}]

Out[2]= [image]
```

Use ``PlotStyle`` to change the plot colors:

```wl
In[3]:= SystemModelPlot[sim, {"x1", "x2", "x3", "x4", "x5"}, PlotStyle -> ColorData[90, "ColorList"]]

Out[3]= [image]
```

---

``Filling`` can be used to specify fill regions and styles:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= SystemModelPlot[sim, {"x1", "x4"}, PlotStyle -> Thick, Filling -> Axis]

Out[2]= [image]
```

Fill between the two curves:

```wl
In[3]:= SystemModelPlot[sim, {"x1", "x4"}, PlotStyle -> Thick, Filling -> {1 -> {2}}]

Out[3]= [image]
```

---

A legend is automatically shown for plots with multiple variables:

```wl
In[1]:= sim = SystemModelSimulate[[image], {0, 10}];

In[2]:= SystemModelPlot[sim, {"x1", "x2"}]

Out[2]= [image]
```

Turn off ``PlotLegends`` :

```wl
In[3]:= SystemModelPlot[sim, {"x1", "x2"}, PlotLegends -> None]

Out[3]= [image]
```

Style legends:

```wl
In[4]:= SystemModelPlot[sim, {"x1", "x2"}, PlotLegends -> SwatchLegend[Automatic, LegendLabel -> "Variables"]]

Out[4]= [image]
```

---

Events can be illustrated with ``Mesh`` points:

```wl
In[1]:= sim = SystemModelSimulate[[image], 3];

In[2]:= SystemModelPlot[sim, {"h"}, Mesh -> "Events"]

Out[2]= [image]
```

For multiple simulations:

```wl
In[3]:= sim2 = SystemModelSimulate[[image], 3, <|"InitialValues" -> {"h" -> 2}|>]

Out[3]=
SystemModelSimulationData["/tmp/WolframSystemModeler-secavarat-14.3/WL/wsml_BouncingBall_lsim_49633\
_45830_697664026826346172917185074408_1.mat", "DocumentationExamples.Simulation.BouncingBall", 8, 
 {0., 3.}, "/tmp/WolframSystemModeler-secavarat- ... -6, 
  "DisplayTimeUnit" -> None, "Epoch" -> None, "DisplayTimeZone" -> Automatic, 
  "InterpolationPoints" -> 2000, "Method" -> Automatic, "StepSize" -> 0, 
  "SynchronizeWithRealTime" -> False, "SimulationRate" -> 1., "CommunicationRate" -> 20]]

In[4]:= SystemModelPlot[{sim2, sim}, {"h"}, Mesh -> "Events"]

Out[4]= [image]
```

---

Use any expressions in plot legends:

```wl
In[1]:= SystemModelPlot[[image], {"y", "z"'}, PlotLegends -> {y[t], z'[t] == -a y[t]}]

Out[1]= [image]
```

---

Do multiple simulations:

```wl
In[1]:= sim = SystemModelSimulate[[image], {0, 3}, <|"InitialValues" -> {"x" -> {1, 2, 3}}|>];
```

The plot legends show which simulation the curve belongs to:

```wl
In[2]:= SystemModelPlot[sim, {"x"}]

Out[2]= [image]
```

---

``SystemModelPlot`` sets the option ``AxesLabel`` :

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= SystemModelPlot[sim, {"y", "z"'}]

Out[2]= [image]
```

Override by setting ``AxesLabel`` :

```wl
In[3]:= SystemModelPlot[sim, {"y", "z"'}, AxesLabel -> {"t", "x(t)"}]

Out[3]= [image]
```

---

Wrappers like ``Style`` can be used for styling variables:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= SystemModelPlot[sim, {Style["x1", Thick], Style["x4", Green]}]

Out[2]= [image]
```

---

Set a custom ``Tooltip`` :

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= SystemModelPlot[sim, {Tooltip["x1", "This is x1"], "x4"}]

Out[2]= [image]
```

---

Plots are shown in display units defined in the model:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= vars = {"mass1.T", "mass2.T"};

In[3]:= SystemModelPlot[sim, vars]

Out[3]= [image]
```

Use ``TargetUnits`` to choose a different unit:

```wl
In[4]:= SystemModelPlot[sim, vars, TargetUnits -> "DegreesFahrenheit"]

Out[4]= [image]
```

### Options (17)

#### PlotLegends (1)

Use variable names as ``PlotLegends`` :

```wl
In[1]:= SystemModelPlot[[image], {"inertia1.w", "inertia2.w"}, 2, PlotLegends -> "Expressions"]

Out[1]= [image]
```

Use variable descriptions:

```wl
In[2]:= SystemModelPlot[[image], {"inertia1.phi", "resistor1.i"}, 3, PlotLegends -> "Descriptions"]

Out[2]= [image]
```

#### ProgressReporting (1)

Control progress reporting with ``ProgressReporting`` :

```wl
In[1]:= SystemModelPlot[[image], ProgressReporting -> False]

Out[1]= [image]
```

#### ScalingFunctions (2)

Plot the model with log-scaled values using ``ScalingFunctions`` :

```wl
In[1]:=
SystemModelPlot[AffineStateSpaceModel[{{x1, 2*x2}, {{}}}, 
 {{x1, 1}, {x2, 1}}], {x1, x2}, ScalingFunctions -> "Log"]

Out[1]= [image]
```

---

Models with ``"Epoch"`` in its simulation settings are plotted as values at a sequence of dates:

```wl
In[1]:= model = SystemModel[[image], <|"ModelName" -> "MyModel", "SimulationSettings" -> {"Epoch" -> Now}|>]

Out[1]= [image]
```

Plot the model:

```wl
In[2]:= SystemModelPlot[model, {"H", "L"}]

Out[2]= [image]
```

Use ``ScalingFunctions -> {None, Automatic}`` to produce simulation time plots instead:

```wl
In[3]:= SystemModelPlot[model, {"H", "L"}, ScalingFunctions -> {None, Automatic}, TargetUnits -> {"Years", Automatic}]

Out[3]= [image]
```

Use ``DateTicksFormat`` to format for date tick labels:

```wl
In[4]:= SystemModelPlot[model, {"H", "L"}, ScalingFunctions -> {DateScale[DateTicksFormat -> "YearShort"], Automatic}]

Out[4]= [image]
```

#### TargetUnits (5)

Plot different units in the same plot:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= vars = {"mass1.T", "conduction.Q_flow"};

In[3]:= SystemModelPlot[sim, vars]

Out[3]= [image]
```

---

Variables of the same physical dimension are converted to the same unit:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= vars = {"distance", "distanceCm"};

In[3]:= SystemModelPlot[sim, vars]

Out[3]= [image]
```

Use ``"IndividualDisplayUnit"`` to use the given display unit for each variable:

```wl
In[4]:= SystemModelPlot[sim, vars, TargetUnits -> "IndividualDisplayUnit"]

Out[4]= [image]
```

---

Use an explicitly given unit:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= vars = {"distance", "distanceCm"};

In[3]:= SystemModelPlot[sim, vars, TargetUnits -> "m"]

Out[3]= [image]
```

---

Plot in a common base unit from the model:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= vars = {"temp", "tempC"};

In[3]:= SystemModelPlot[sim, vars, TargetUnits -> "Unit"]

Out[3]= [image]
```

Use the individual base units without converting to a common unit:

```wl
In[4]:= SystemModelPlot[sim, vars, TargetUnits -> "IndividualUnit"]

Out[4]= [image]
```

---

Turn off unit handling completely for maximum performance:

```wl
In[1]:= sim = SystemModelSimulate[[image]];

In[2]:= vars = {"temp", "tempC"};

In[3]:= SystemModelPlot[sim, vars, TargetUnits -> None]

Out[3]= [image]
```

#### Ticks (4)

Ticks are placed automatically in each plot:

```wl
In[1]:= SystemModelPlot[[image]]

Out[1]= [image]
```

---

Use ``Ticks -> None`` to not draw any tick marks:

```wl
In[1]:= SystemModelPlot[[image], Ticks -> None]

Out[1]= [image]
```

---

Place tick marks at specific positions:

```wl
In[1]:= SystemModelPlot[[image], Ticks -> {{.4, .8, 1.3}, {-.6, .1, .6}}]

Out[1]= [image]
```

---

Draw tick marks at the specified positions with the specified labels:

```wl
In[1]:= SystemModelPlot[[image], Ticks -> {{{.4, a}, {.8, b}, {1.3, c}}, {{-.6, -d}, {.1, e}, {.6, d}}}]

Out[1]= [image]
```

#### TicksStyle (4)

Specify overall tick style, including the tick labels:

```wl
In[1]:= SystemModelPlot[[image], TicksStyle -> Directive[Blue, Thick]]

Out[1]= [image]
```

---

Specify overall tick style for each of the axes:

```wl
In[1]:= SystemModelPlot[[image], TicksStyle -> {Directive[Blue, Thick], Directive[Red, Thick]}]

Out[1]= [image]
```

---

Specify tick marks with scaled lengths:

```wl
In[1]:= SystemModelPlot[[image], Ticks -> {{{.4, a, .05}, {.8, b, .05}, {1.3, c, .05}}, {{-.6, -d, .1}, {.1, e, .1}, {.6, d, .1}}}]

Out[1]= [image]
```

---

Customize each tick with position, length, labeling and styling:

```wl
In[1]:= SystemModelPlot[[image], Ticks -> {{{.4, a, .05, Directive[Red, Thick]}, {.8, b, .05, Directive[Red, Thick]}, {1.3, c, .05, Directive[Red, Thick]}}, {{-.6, -d, .47, Directive[Purple, Thick]}, {.1, e, .1, Directive[Purple, Thick]}, {.6, d, .38, Directive[Purple, Thick]}}}]

Out[1]= [image]
```

### Applications (3)

Do a parameter sweep:

```wl
In[1]:= sim = SystemModelSimulate[[image], 4, <|"ParameterValues" -> {{"springDamper1.d", Range[2, 14, 2]}}|>];

In[2]:= SystemModelPlot[sim, {"slidingMass1.s"}, PlotRange -> All]

Out[2]= [image]
```

Compare the different simulations to a first-order system:

```wl
In[3]:= sol = NDSolve[{0.2y'[t] + y[t] == 0.05, y[0] == 0}, {y}, {t, 0, 4}];

In[4]:= Show[Plot[y[t] /. sol, {t, 0, 4}, PlotRange -> All, PlotStyle -> {Red, Thick}], SystemModelPlot[sim, {"slidingMass1.s"}, PlotRange -> All, PlotStyle -> Thin]]

Out[4]= [image]
```

---

Find out which of three parameters a model is most sensitive to:

```wl
In[1]:= pars = {"sine.amplitude", "sine.f", "gain.k"};

In[2]:= sim = SystemModelSimulateSensitivity[[image], 5, pars];
```

A 5% sensitivity bound on the output shows that ``"sine.f"`` has the highest impact:

```wl
In[3]:= Column[Table[SystemModelPlot[sim, {{"integrator.y", p, 0.05}}, PlotLabel -> p], {p, pars}]]

Out[3]= [image]
```

---

Show a custom explanatory legend:

```wl
In[1]:= sims = SystemModelSimulate[[image], 4, <|"ParameterValues" -> {"g" -> {23.12, 9.82, 1.62}}|>];

In[2]:= SystemModelPlot[sims, {"h"}, PlotLegends -> SwatchLegend[{"Jupiter", "Earth", "Moon"}, LegendLabel -> "Bouncing ball on:"]]

Out[2]= [image]
```

### Properties & Relations (5)

``SystemModelPlot`` is related to ``Plot`` :

```wl
In[1]:= sim = SystemModelSimulate[[image], {0, 10}];
```

Select the variables you want to plot:

```wl
In[2]:= vars = {"x1", "x2"};
```

Plot using ``SystemModelPlot`` :

```wl
In[3]:= SystemModelPlot[sim, vars]

Out[3]= [image]
```

Plot using ``Plot`` :

```wl
In[4]:= Plot[Evaluate@sim[vars, t], {t, 0, 10}]

Out[4]= [image]
```

---

``SystemModel`` can define a plot in a model:

```wl
In[1]:= model = SystemModel[[image], <|"Plots" -> <|"Name" -> "MyPlot", "Variables" -> {"y", "z"}|>|>];
```

Simulate and show the newly defined plot:

```wl
In[2]:= SystemModelPlot[model, "MyPlot", 10]

Out[2]= [image]
```

---

Use ``Plot`` to show variables of different magnitude in the same plot:

```wl
In[1]:= sim = SystemModelSimulate[[image], 100];
```

Retrieve results from a simulation:

```wl
In[2]:= {ϕ, ω} = sim[{"inertia1.phi", "inertia1.w"}];
```

Scale the rotational angle by a factor of 50 and show it with the rotational velocity:

```wl
In[3]:= Plot[{ϕ[t] / 50, ω[t]}, {t, 0, 100}, PlotLegends -> "Expressions"]

Out[3]= [image]
```

---

Simulate a rolling wheel:

```wl
In[1]:= sim = SystemModelSimulate[[image], {0, 4}]

Out[1]=
SystemModelSimulationData["/tmp/WolframSystemModeler-secavarat-14.3/WL/wsml_RollingWheel_lsim_49633\
_45830_697664026833665902826058242326_1.mat", 
 "Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel", 498, {0., 4.}, "/tmp/WolframSyste\ ... -6, "DisplayTimeUnit" -> None, "Epoch" -> None, 
  "DisplayTimeZone" -> Automatic, "InterpolationPoints" -> 2000, "Method" -> Automatic, 
  "StepSize" -> 0, "SynchronizeWithRealTime" -> False, "SimulationRate" -> 1., 
  "CommunicationRate" -> 20]]
```

Get the $x$ and $y$ positions of the wheel axis:

```wl
In[2]:= {wheelx, wheely} = sim[{"wheel1.x", "wheel1.y"}, t];
```

Plot the position with a ``ParametricPlot`` :

```wl
In[3]:= ParametricPlot[{wheelx, wheely}, Evaluate@Prepend[sim["SimulationInterval"], t]]

Out[3]= [image]
```

---

Use ``SystemModelUncertaintyPlot`` to plot model variables when parameter values, initial values or inputs are uncertain:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"ParameterValues" -> {"R" -> Quantity[Interval[{2, 7}], "Milliohms"]}|>]

Out[1]= [image]
```

### Possible Issues (1)

When plotting from a simulation, the interval in ``SystemModelPlot`` narrows the time interval plotted:

```wl
In[1]:=
model = [image];
sim = SystemModelSimulate[model, {0, 10}, <|"InitialValues" -> {"h" -> 2}|>];
SystemModelPlot[sim, {"h"}, {0.5, 2}, PlotRange -> All]

Out[1]= [image]
```

When plotting a model, the interval in ``SystemModelPlot`` determines the simulation start and stop time:

```wl
In[2]:= SystemModelPlot[model, {"h"}, {0.5, 2}, <|"InitialValues" -> {"h" -> 2}|>, PlotRange -> All]

Out[2]= [image]
```

### Neat Examples (1)

Simulate a Newton's cradle:

```wl
In[1]:= sim = SystemModelSimulate[[image], {0, 90}, <|"ParameterValues" -> {"e" -> 0.98}, "InitialValues" -> {"angle1" -> (π/2), "angle2" -> (π/3)}|>];
```

Show the $x$ position of each of the five balls:

```wl
In[2]:= SystemModelPlot[sim, {"x1", "x2", "x3", "x4", "x5"}]

Out[2]= [image]
```

## See Also

* [`SystemModelSimulationData`](https://reference.wolfram.com/language/ref/SystemModelSimulationData.en.md)
* [`SystemModelSimulate`](https://reference.wolfram.com/language/ref/SystemModelSimulate.en.md)
* [`SystemModelSimulateSensitivity`](https://reference.wolfram.com/language/ref/SystemModelSimulateSensitivity.en.md)
* [`SystemModelUncertaintyPlot`](https://reference.wolfram.com/language/ref/SystemModelUncertaintyPlot.en.md)
* [`Plot`](https://reference.wolfram.com/language/ref/Plot.en.md)
* [`ParametricPlot`](https://reference.wolfram.com/language/ref/ParametricPlot.en.md)
* [`SystemModel`](https://reference.wolfram.com/language/ref/SystemModel.en.md)
* [`SystemModelExamples`](https://reference.wolfram.com/language/ref/SystemModelExamples.en.md)

## Tech Notes

* [Getting Started with Model Simulation and Analysis](https://reference.wolfram.com/language/tutorial/GettingStartedWithModelSimulationAndAnalysis.en.md)

## Related Guides

* [System Model Analytics & Design](https://reference.wolfram.com/language/guide/SystemModelAnalyticsDesign.en.md)
* [System Modeling Overview](https://reference.wolfram.com/language/guide/SystemModelingOverview.en.md)
* [System Model Simulation](https://reference.wolfram.com/language/guide/SystemModelSimulation.en.md)
* [Systems Modeling](https://reference.wolfram.com/language/guide/SystemsModeling.en.md)
* [Life Sciences & Medicine: Data & Computation](https://reference.wolfram.com/language/guide/LifeSciencesAndMedicineDataAndComputation.en.md)

## Related Links

* [Wolfram System Modeler Documentation](http://reference.wolfram.com/system-modeler/)

## History

* [Introduced in 2018 (11.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn113.en.md) \| [Updated in 2020 (12.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn122.en.md) ▪ [2022 (13.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn132.en.md)