Multiple Plots

This example shows two plots in one graph; one plot uses bars and the other uses lines. Multigraph automatically adds a legend when there is more than one plot in a graph.

Here is the MUGL for this example:

<?xml version="1.0"?>
<mugl>
  <horizontalaxis id="x" min="0" max="10"/>
  <verticalaxis   id="y" min="0" max="10"/>
  <verticalaxis   id="z" min="0" max="10" position="0" positionbase="right"/>
  <plot>
    <horizontalaxis ref="x">
      <variable ref="x"/>
    </horizontalaxis>
    <verticalaxis ref="y">
      <variable ref="y"/>
    </verticalaxis>
    <renderer type="bar">
      <option name="fillcolor"  value="green"/>
      <option name="linecolor" value="black"/>
      <option name="linethickness" value="2"/>
      <option name="barwidth" value="1"/>
      <option name="baroffset" value="0"/>
    </renderer>
  </plot>
  <plot>
    <horizontalaxis ref="x">
      <variable ref="x"/>
    </horizontalaxis>
    <verticalaxis ref="z">
      <variable ref="z"/>
    </verticalaxis>
    <renderer type="line">
      <option name="linecolor" value="black"/>
      <option name="dotcolor"  value="blue"/>
    </renderer>
  </plot>
  <data>
    <variables>
      <variable id="x"/>
      <variable id="y"/>
      <variable id="z"/>
    </variables>
    <values>
      0, 3, 3
      1, 2, 0
      2, 4, 6
      3, 5, 2
      4, 3, 1
      5, 6, 3
      6, 7, 7
      7, 8, 8
      8, 5, 2
    </values>
  </data>
</mugl>
Note: this web site is for the old, Flash-based, version of Multigraph. Starting in December 2012, there is a new JavaScript/HTML5 version of Multigraph, which is distributed from the site multigraph.github.io. Future projects should use the new JavaScript/HTML5 version of Multigraph rather than the Flash version described here.