Plot Types

Before we look at how to create a plot, we have to discuss the three types of plots that you have at your disposal. 

Example 1: xyPlot

xyPlot are line plots whose inputs are Cartesian coordinates of the form (x,y). Pan/zoom is enabled by default. You would use this plot if you were inputting raw data, or animating a concept that requires axis labels.

You can copy this example into your document as-is.

<xyPlot>
  <series>
    <data>0 0; 1 2; 2 -3; 3 5</data>
  </series>
</xyPlot>
 
xyplot.jpg
 

Example 2: timePlot

The second is timePlot, which defines a line plot whose inputs are Cartesian coordinates of the form (t,y), where the x-axis represents time. Pan/zoom is enabled by default. You would use this plot to output the results of a simulation. 

You can copy this example into your document as a top-level section (i.e. not inside any other sections).

<sectionNoTitle name="section2">
  
  <timePlot name="myPlot" />

  <simulation name="sineSim">
    <onActivePageChanged>
      if active then
        sineSim:Start()
      else
        sineSim:Stop()
      end
    </onActivePageChanged>
    <solver>
      <series>
        <sine />
        <probe ref="section2.myPlot" />
      </series>
    </solver>
  </simulation>

</sectionNoTitle>
 
timeplot.jpg
 

Example 3: Drawing

The third is drawing, which defines a line plot whose inputs are Cartesian coordinates of the form (x,y). Drawing differs from xyPlot and timePlot in that gridlines are not displayed, and pan/zoom is disabled. You would use this plot if you were animating a realistic-looking concept.

You can copy this example into your document as-is.

<drawing>
  <series>
    <data>0 0; 1 2; 2 -3; 3 5</data>
  </series>
</drawing>
 
drawing.jpg