Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
98 - 1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!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>
3
<code class="function">SetLegendUseShapes</code> sets the legend to use either color
4
boxes or shapes marker to show which legend line goes with which data set.
5
    </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>
6
A boolean value: true to use shape markers, false to use color boxes.
7
          </p></dd></dl></div></div><div class="refsect1"><a id="idp1378324340"></a><h2>Notes</h2><p>
8
By default, the legend is drawn with color boxes.
9
    </p><p>
10
Use of <code class="literal">SetLegendUseShapes(True)</code> instructs PHPlot to use
11
an alternate marker in the legend. The marker depends on the
12
<a class="link" href="conc-plottypes.html" title="3.4. PHPlot Plot Types">plot type</a> used in the plot.
13
      </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
14
For <a class="link" href="conc-plottypes.html#plottype-points" title="3.4.11. Plot Type: points (Styled Dot Plot)">points</a> and
15
<a class="link" href="conc-plottypes.html#plottype-linepoints" title="3.4.7. Plot Type: linepoints (Lines and Points Plot)">linepoints</a> plots,
16
the alternate marker is the point shape used to identify the data set in
17
the plot.
18
          </p></li><li class="listitem"><p>
19
For <a class="link" href="conc-plottypes.html#plottype-lines" title="3.4.8. Plot Type: lines (Lines Plot)">lines</a> and
20
<a class="link" href="conc-plottypes.html#plottype-squared" title="3.4.12. Plot Type: squared (Squared Plot)">squared</a> plots,
21
the alternate marker is a short horizontal line segment matching the
22
corresponding data set line in the plot.
23
          </p></li><li class="listitem"><p>
24
For all other plot types, no alternate marker is defined, and
25
<code class="function">SetLegendUseShapes</code> is ignored.
26
          </p></li></ul></div><p>
27
    </p><p>
28
When shape markers are enabled using
29
<code class="function">SetLegendUseShapes(True)</code>,
30
PHPlot will first draw a solid box with the same color as the plot area
31
background (if plot area background color is enabled with
32
<a class="xref" href="SetPlotBgColor.html" title="SetPlotBgColor"><span class="refentrytitle">SetPlotBgColor</span></a> and
33
<a class="xref" href="SetDrawPlotAreaBackground.html" title="SetDrawPlotAreaBackground"><span class="refentrytitle">SetDrawPlotAreaBackground</span></a>).
34
Then it will draw the shape marker, overlaying the background box.
35
    </p><p>
36
Point shape markers will have the same color and size as the
37
point shape used in the plot for the corresponding data set.
38
Note that PHPlot will not adjust the legend box size or line spacing based on
39
the point shape sizes set with <a class="xref" href="SetPointSizes.html" title="SetPointSizes"><span class="refentrytitle">SetPointSizes</span></a>.
40
If the point shapes are too big, they will overflow their allocated space
41
and overlap.  You can control the legend text line height to account for large
42
point shapes by adjusting the line spacing parameter (using
43
<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>,
44
or related font control functions.
45
    </p><p>
46
Line segment markers will have the same color, line width, and style as the
47
lines used in the corresponding data set.
48
The area reserved in the legend for color boxes or shape markers is
49
automatically made 4 times wider when line segment markers are used,
50
in order to improve visibility.
51
    </p><p>
52
For examples of legends with color boxes and shape markers,
53
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>.
54
    </p></div><div class="refsect1"><a id="idp1378334308"></a><h2>History</h2><p>
55
PHPlot-6.0.0 added a third type of shape marker for legends: line segments,
56
and <code class="function">SetLegendUseShapes</code> now applies to more plot types.
57
Before PHPlot-6.0.0, only color boxes and point shape markers
58
were available, and <code class="function">SetLegendUseShapes</code>
59
was ignored with plot types other than <code class="literal">points</code> and
60
<code class="literal">linepoints</code>.
61
    </p><p>
62
This function was added to PHPlot-5.4.0.
63
Before that, only color boxes were available in legends.
64
    </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>