Plotting Figure Annotations

You can plot Figure annotations.


Before you begin: In this scenario, you create a simple free-standing model with a Figure annotation and plot the result.
  1. Create a free-standing empty model with the name MyFigureTest.

    For more information about creating a model, see Creating an Empty Class or Extending from an Existing Class.

  2. In the model, enter a Modelica text as the below:

    model MyFigureTest
      Real x(
        start=1,
        unit="m") = sin(time);
      Real y(
        start=1,
        unit="m") = cos(time);
    equation 
    
      annotation (experiment(StopTime=5.0), Documentation(figures={Figure(
              title="My figure",
              identifier="105c9",
              plots={Plot(curves={Curve(y=x)})})}));
    end MyFigureTest;

    Note: This example is a very simple Figure annotation. For more information about the Figure annotation, see Modelica Language Specification version 3.5, available at www.modelica.org.

  3. Simulate the model.

    For more information about simulation, see Simulating a Behavior.

  4. From the Variable Browser, right-click any signal, and select Predefined Actions > Plot Figure > My figure .
    A plot window appears:

    For information on how to enter Modelica text in a model, see Displaying and Editing Modelica Text.