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>SetLegendUseShapes</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="reference.html" title="PHPlot Function Reference" /><link rel="prev" href="SetLegendTextColor.html" title="SetLegendTextColor" /><link rel="next" href="SetLegendWorld.html" title="SetLegendWorld" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetLegendUseShapes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetLegendTextColor.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetLegendWorld.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetLegendUseShapes"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetLegendUseShapes</span></h2><p>SetLegendUseShapes &#8212; Use color boxes or shape markers in the legend</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot-&gt;SetLegendUseShapes(<em class="parameter"><code>$use_shapes</code></em>)</pre></div><div class="refsect1"><a id="idp1378321740"></a><h2>Description</h2><p>
<code class="function">SetLegendUseShapes</code> sets the legend to use either color
boxes or shapes marker to show which legend line goes with which data set.
    </p></div><div class="refsect1"><a id="idp1378322812"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$use_shapes</code></em></span></dt><dd><p>
A boolean value: true to use shape markers, false to use color boxes.
          </p></dd></dl></div></div><div class="refsect1"><a id="idp1378324340"></a><h2>Notes</h2><p>
By default, the legend is drawn with color boxes.
    </p><p>
Use of <code class="literal">SetLegendUseShapes(True)</code> instructs PHPlot to use
an alternate marker in the legend. The marker depends on the
<a class="link" href="conc-plottypes.html" title="3.4. PHPlot Plot Types">plot type</a> used in the plot.
      </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
For <a class="link" href="conc-plottypes.html#plottype-points" title="3.4.11. Plot Type: points (Styled Dot Plot)">points</a> and
<a class="link" href="conc-plottypes.html#plottype-linepoints" title="3.4.7. Plot Type: linepoints (Lines and Points Plot)">linepoints</a> plots,
the alternate marker is the point shape used to identify the data set in
the plot.
          </p></li><li class="listitem"><p>
For <a class="link" href="conc-plottypes.html#plottype-lines" title="3.4.8. Plot Type: lines (Lines Plot)">lines</a> and
<a class="link" href="conc-plottypes.html#plottype-squared" title="3.4.12. Plot Type: squared (Squared Plot)">squared</a> plots,
the alternate marker is a short horizontal line segment matching the
corresponding data set line in the plot.
          </p></li><li class="listitem"><p>
For all other plot types, no alternate marker is defined, and
<code class="function">SetLegendUseShapes</code> is ignored.
          </p></li></ul></div><p>
    </p><p>
When shape markers are enabled using
<code class="function">SetLegendUseShapes(True)</code>,
PHPlot will first draw a solid box with the same color as the plot area
background (if plot area background color is enabled with
<a class="xref" href="SetPlotBgColor.html" title="SetPlotBgColor"><span class="refentrytitle">SetPlotBgColor</span></a> and
<a class="xref" href="SetDrawPlotAreaBackground.html" title="SetDrawPlotAreaBackground"><span class="refentrytitle">SetDrawPlotAreaBackground</span></a>).
Then it will draw the shape marker, overlaying the background box.
    </p><p>
Point shape markers will have the same color and size as the
point shape used in the plot for the corresponding data set.
Note that PHPlot will not adjust the legend box size or line spacing based on
the point shape sizes set with <a class="xref" href="SetPointSizes.html" title="SetPointSizes"><span class="refentrytitle">SetPointSizes</span></a>.
If the point shapes are too big, they will overflow their allocated space
and overlap.  You can control the legend text line height to account for large
point shapes by adjusting the line spacing parameter (using
<a class="xref" href="SetLineSpacing.html" title="SetLineSpacing"><span class="refentrytitle">SetLineSpacing</span></a>, <a class="xref" href="SetFont.html" title="SetFont"><span class="refentrytitle">SetFont</span></a>,
or related font control functions.
    </p><p>
Line segment markers will have the same color, line width, and style as the
lines used in the corresponding data set.
The area reserved in the legend for color boxes or shape markers is
automatically made 4 times wider when line segment markers are used,
in order to improve visibility.
    </p><p>
For examples of legends with color boxes and shape markers,
see <a class="xref" href="ex-legendshape.html" title="5.35. Example - Legend with Shape Markers">Section 5.35, &#8220;Example - Legend with Shape Markers&#8221;</a>.
    </p></div><div class="refsect1"><a id="idp1378334308"></a><h2>History</h2><p>
PHPlot-6.0.0 added a third type of shape marker for legends: line segments,
and <code class="function">SetLegendUseShapes</code> now applies to more plot types.
Before PHPlot-6.0.0, only color boxes and point shape markers
were available, and <code class="function">SetLegendUseShapes</code>
was ignored with plot types other than <code class="literal">points</code> and
<code class="literal">linepoints</code>.
    </p><p>
This function was added to PHPlot-5.4.0.
Before that, only color boxes were available in legends.
    </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetLegendTextColor.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="SetLegendWorld.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetLegendTextColor </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetLegendWorld</td></tr></table></div></body></html>