WSMPlot
WSMPlot[sim]
shows preferred plots from the WSMSimulationData object sim.
WSMPlot[sim,"name"]
shows stored plot "name".
WSMPlot[sim,{"v1","v2",…}]
generates a plot of the variables vi in sim.
WSMPlot[{sim1,sim2,…},…]
plots variables from several simulations.
WSMPlot["mmodel",…]
plots from a new simulation of "mmodel".
Details and Options
- WSMPlot[…,{tmin,tmax}] plots from tmin to tmax.
- WSMPlot[{"mmodel",args},…] generates simulation data using WSMSimulate["mmodel",args].
- WSMPlot[conn,…] takes simulation data from a WSMSimulationConnection.
- WSMPlot[sim,{{"v1","p1",di},…},…] plots variables vi and sensitivity bounds when parameter pi varies 100di%. »
- The shortest unique model name mmodel can be used where WSMNames["*.mmodel"] gives a unique match.
- A list of stored plots for WSMSimulationData sim is available with sim["PlotNames"].
- Variables vi can be given as strings or using DotName.
- WSMPlot 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 uses variable names vi 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 unit explicit unit - "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.
Examples
open allclose allBasic Examples (5)
Scope (21)
Variable Specification (3)
Plot variables from a model simulation:
Give variables using DotName:
Show bounds when varying a parameter:
Show the estimated capacitor voltage variation when varying the frequency by 5%:
Time Specification (1)
Simulation Specification (4)
Simulate and plot a model from 0 to 5:
Simulate a model with given initial values and plot the result:
Simulate an oscillating mass on a spring, with a damper acting on the spring:
Use three different values for the damping constant:
Compare the oscillation of the mass with the different levels of damping:
Launch a simulation in real time, writing results to a file:
Stored Plots (3)
Presentation (10)
Multiple variables are automatically colored to be distinct:
Use PlotStyle to change the plot colors:
Filling can be used to specify fill regions and styles:
A legend is automatically shown for plots with multiple variables:
Turn off PlotLegends:
Events can be illustrated with Mesh points:
Use any expressions in plot legends:
The plot legends show which simulation the curve belongs to:
WSMPlot sets the option AxesLabel:
Override by setting AxesLabel:
Wrappers like Style can be used for styling variables:
Set a custom Tooltip:
Plots are shown in display units defined in the model:
Use TargetUnits to choose a different unit:
Options (6)
PlotLegends (1)
Use variable names as PlotLegends:
TargetUnits (5)
Applications (3)
Properties & Relations (5)
WSMPlot is related to Plot:
Select the variables you want to plot:
Plot using Plot:
WSMSetPlot stores a plot in a model:
Simulate and show the newly defined plot:
Use Plot to show variables of different magnitude in the same plot:
Retrieve results from a simulation:
Scale the rotational angle by a factor of 50 and show it with the rotational velocity:
Get the and position of the wheel axis:
Plot the position with a ParametricPlot:
Show a plot of a simulation running in real time: