Subversion Repositories cheapmusic

Rev

Blame | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>3.7. Other Plot Elements</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="concepts.html" title="Chapter 3. PHPlot Concepts" /><link rel="prev" href="conc-labels.html" title="3.6. Labels" /><link rel="next" href="conc-text.html" title="3.8. Text Fonts" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.7. Other Plot Elements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="conc-labels.html">Prev</a> </td><th width="60%" align="center">Chapter 3. PHPlot Concepts</th><td width="20%" align="right"> <a accesskey="n" href="conc-text.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="conc-otherelements"></a>3.7. Other Plot Elements</h2></div></div></div><div class="abstract"><p class="title"><strong></strong></p><p>
This section contains information about other elements which can be part of
a plot.
  </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="conc-titles"></a>3.7.1. Titles</h3></div></div></div><p>
PHPlot can draw three types of titles:
  </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
The main plot title, which is centered at the top of the image.
This is typically used to identify the plot as a whole.
      </p></li><li class="listitem"><p>
The X title, which is drawn horizontally and can appear below the plot,
above the plot, or in both places.
This is typically used to identify the values along the X axis.
      </p></li><li class="listitem"><p>
The Y title, which is drawn vertically and can appear to the left of the plot,
to the right of the plot, or on both sides.
This is typically used to identify the values along the Y axis.
      </p></li></ul></div><p>
For a list of functions used to control titles,
see <a class="xref" href="ref-titles.html" title="6.7. Titles">Section 6.7, &#8220;Titles&#8221;</a>.
</p><p>

Here is a sample plot with the titles called out.
</p><div class="informalfigure"><div class="mediaobject"><img src="images/typical-titles.png" alt="Titles on a plot" /></div></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="conc-legend"></a>3.7.2. Legend</h3></div></div></div><p>
PHPlot can draw a legend on the plot. This is normally used with multiple
data sets, to identify the data sets by color.
A legend can also be used with pie charts to identify the segments.
For a list of functions used to control the legend,
see <a class="xref" href="ref-legend.html" title="6.8. Legend">Section 6.8, &#8220;Legend&#8221;</a>.
</p><p>
  </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Use <a class="xref" href="SetLegend.html" title="SetLegend"><span class="refentrytitle">SetLegend</span></a> to enable the legend and define the text lines
to be displayed.
      </p></li><li class="listitem"><p>
You can let PHPlot position the legend, or position it yourself with
<a class="xref" href="SetLegendPixels.html" title="SetLegendPixels"><span class="refentrytitle">SetLegendPixels</span></a>, <a class="xref" href="SetLegendWorld.html" title="SetLegendWorld"><span class="refentrytitle">SetLegendWorld</span></a>,
or <a class="xref" href="SetLegendPosition.html" title="SetLegendPosition"><span class="refentrytitle">SetLegendPosition</span></a>.
      </p></li><li class="listitem"><p>
You can change the legend text color with <a class="xref" href="SetTextColor.html" title="SetTextColor"><span class="refentrytitle">SetTextColor</span></a> or
<a class="xref" href="SetLegendTextColor.html" title="SetLegendTextColor"><span class="refentrytitle">SetLegendTextColor</span></a>, and the
background color with <a class="xref" href="SetLegendBgColor.html" title="SetLegendBgColor"><span class="refentrytitle">SetLegendBgColor</span></a>.
You can control the color box border colors with
<a class="xref" href="SetLegendColorboxBorders.html" title="SetLegendColorboxBorders"><span class="refentrytitle">SetLegendColorboxBorders</span></a>.
The colors of the color boxes or shape markers automatically match the
colors of the plotted data sets, and you cannot control those colors
separately from the data colors.
See also <a class="xref" href="conc-colors.html#conc-colors-elements" title="3.5.5. Plot Element Colors">Section 3.5.5, &#8220;Plot Element Colors&#8221;</a>.
      </p></li><li class="listitem"><p>
Other aspects of the legend appearance can also be changed.
Use <a class="xref" href="SetLegendStyle.html" title="SetLegendStyle"><span class="refentrytitle">SetLegendStyle</span></a> to control the text and color box
alignment, <a class="xref" href="SetLegendUseShapes.html" title="SetLegendUseShapes"><span class="refentrytitle">SetLegendUseShapes</span></a> to select color boxes or
shape markers, and <a class="xref" href="SetLegendReverse.html" title="SetLegendReverse"><span class="refentrytitle">SetLegendReverse</span></a> if you want the
entries in the legend ordered from bottom to top.
      </p></li></ul></div><p>
</p><p>

Here is a sample plot with the legend called out.
</p><div class="informalfigure"><div class="mediaobject"><img src="images/typical-legend.png" alt="Legend on a plot" /></div></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="conc-grid"></a>3.7.3. Grid Lines</h3></div></div></div><p>
PHPlot can draw horizontal (Y) and/or vertical (X) grid lines on a plot.
You can independently enable the horizontal (Y) and vertical (X)
lines in the grid, and use dashed or solid lines.
For a list of functions used to control the grid,
see <a class="xref" href="ref-grid.html" title="6.10. Grid Controls">Section 6.10, &#8220;Grid Controls&#8221;</a>.
</p><p>

Here is a sample plot with the X Grid and Y Grid called out.
</p><div class="informalfigure"><div class="mediaobject"><img src="images/typical-grid.png" alt="X and Y Grid" /></div></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="conc-ticks"></a>3.7.4. Tick Marks</h3></div></div></div><p>
Tick marks are drawn by default along the bottom edge of the plot (X tick
marks) and the left side of the plot (Y tick marks).
These usually, but not always, correspond to the X and Y axis lines.
You can set the tick interval or control the number of ticks, suppress the
first or last tick on an axis, and control the tick mark size.
You can also anchor the tick marks at a specific X or Y value.
For a list of functions used to control tick marks,
see <a class="xref" href="ref-ticks.html" title="6.12. Ticks">Section 6.12, &#8220;Ticks&#8221;</a>.
</p><p>
Left to its own, PHPlot will determine tick positions for X and Y axes.
(See <a class="xref" href="adv-autorange.html#adv-autorange-tick" title="4.6.7. Automatic Tick Increment Calculation">Section 4.6.7, &#8220;Automatic Tick Increment Calculation&#8221;</a> if you want to read all the
details on how PHPlot does this.)
Starting with PHPlot-6.0.0, an attempt is made to pick a good tick increment.
(Older releases are much less likely to come up with a good result.)
Even so, you might not be happy with the results.
You can improve the situation with some combination of: setting
the desired tick interval, setting a tick anchor point, or using
<a class="xref" href="SetPlotAreaWorld.html" title="SetPlotAreaWorld"><span class="refentrytitle">SetPlotAreaWorld</span></a> to set the X or Y data range limits
(since the automatic calculation of tick marks is based on the data range).
</p><p>
 For example:
</p><pre class="programlisting">$plot-&gt;SetPlotAreaWorld(-10, NULL, 10, NULL);
$plot-&gt;SetXTickIncrement(1);
</pre><p>
This results in the X tick labels going from -10 to 10, with a tick mark
every 1 data unit.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="conc-labels.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="concepts.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="conc-text.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.6. Labels </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.8. Text Fonts</td></tr></table></div></body></html>