Chapter 4. Mugl Files

Table of Contents

4.1. General Structure
4.2. Borders, Margins, and the Plot Area
4.3. Axes
4.4. Plots
4.5. Data
4.5.1. Missing Data
4.6. Styling
4.6.1. Positioning
4.6.2. Axis Label Positioning
4.6.3. Graph Titles
4.6.4. Legends
4.6.5. Grids
4.6.6. Constant Lines
4.6.7. Background Color or Image

4.1. General Structure

"Mugl" files are the way that you specify to multigraph what data should be plotted, how it should be plotted, and any other settings that determine the way the graph looks. Mugl (pronounced "muggle") is short for "Multigraph XML", and is a type of XML file. Each mugl file should begin with the standard <?xml version="1.0"?> declaration, followed by the <mugl> tag. The general structure of a mugl file is shown in Example 4.1, “General Structure of a Mugl File”.

Example 4.1. General Structure of a Mugl File


<?xml version="1.0"?>
<mugl>
  <window .../>
  <plotarea .../>
  <horizontalaxis .../>
  <verticalaxis .../>
  <plot ...>
    ...
  </plot>
  <data ...>
    ...
  </data>
</mugl>


The window element gives the size of the graph, the size of the border to be drawn around it, and the margin amounts inside the border. There can be at most one window element; if it is omitted, multigraph chooses default values for the border and margins, and relies on the window size given in the Multigraph.Graph constructor.

The plotarea element indicates the region inside the graph window where the data will be plotted. There can be at most one plotarea element; if it is omitted, multigraph chooses a reasonable default.

The horizontalaxis and verticalaxis elements give properties related to the display and function of the graph's axes. There can be at most one horizontalaxis element, but any number of verticalaxis elements are allowed.

The plot element indicates properties of the data plot itself, such as style, color, which data variables to plot, and which axes to plot them against. There can be any number of plot elements.

The data element gives the data to be plotted, either by providing the data in a data subelement, or by giving the location of a file or web service from which the data can be read.

The following sections describe these elements in more detail.