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>SetLegendStyle</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="SetLegendReverse.html" title="SetLegendReverse" /><link rel="next" href="SetLegendTextColor.html" title="SetLegendTextColor" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetLegendStyle</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetLegendReverse.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetLegendTextColor.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetLegendStyle"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetLegendStyle</span></h2><p>SetLegendStyle — Control the appearance of the legend</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetLegendStyle(<em class="parameter"><code>$text_align</code></em>, [<span class="optional"><em class="parameter"><code>$colorbox_align</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378300404"></a><h2>Description</h2><p>
|
|
|
3 |
<code class="function">SetLegendStyle</code> controls the appearance of the legend,
|
|
|
4 |
which is drawn if <a class="xref" href="SetLegend.html" title="SetLegend"><span class="refentrytitle">SetLegend</span></a> is used. The legend
|
|
|
5 |
contains of a series of text strings and either color boxes or shape markers,
|
|
|
6 |
identifying the plot lines. SetLegendStyle sets the alignment of
|
|
|
7 |
the text strings and color boxes or shapes markers. First the color boxes or
|
|
|
8 |
shapes markers are aligned within the legend box, left or right, and then the
|
|
|
9 |
text strings are aligned within the remaining space, left or right.
|
|
|
10 |
SetLegendStyle can also turn off the color boxes or shape markers.
|
|
|
11 |
</p></div><div class="refsect1"><a id="idp1378302220"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$text_align</code></em></span></dt><dd><p>
|
|
|
12 |
A string indicating the alignment of the text strings: 'left' or 'right'.
|
|
|
13 |
If 'left', the text strings are left-aligned between the legend box edge
|
|
|
14 |
and the color boxes or shape markers.
|
|
|
15 |
If 'right', the text strings are right-aligned between the legend box edge
|
|
|
16 |
and the color boxes or shape markers.
|
|
|
17 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$colorbox_align</code></em></span></dt><dd><p>
|
|
|
18 |
Optional string indicating the alignment of the color boxes or shape markers:
|
|
|
19 |
'left', 'right', or 'none'.
|
|
|
20 |
If 'left', they are drawn along the left side of the legend box.
|
|
|
21 |
If 'right', they are drawn along the right side of the legend box.
|
|
|
22 |
If 'none', no color boxes or shape markers are drawn.
|
|
|
23 |
If this parameter is omitted, the same alignment as $text_align is used.
|
|
|
24 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378305204"></a><h2>Notes</h2><p>
|
|
|
25 |
By default, the color boxes or shape markers are lined up along the right side
|
|
|
26 |
of the legend box, and the text strings are right-aligned just left of the
|
|
|
27 |
color boxes or shape markers.
|
|
|
28 |
The following figure shows the four possible alignment choices.
|
|
|
29 |
</p><div class="informalfigure"><div class="mediaobject"><img src="images/legendstyle.png" alt="Four possible text/color box alignment choices" /></div></div><p>
|
|
|
30 |
</p><p>
|
|
|
31 |
Using 'none' for $colorbox_align results in a legend with only text lines.
|
|
|
32 |
This is not recommended for multi-line or multi-dataset plots, unless you
|
|
|
33 |
have provided some other way to indicate which legend text line goes with
|
|
|
34 |
which plot, or if you are using the legend for some purpose other than
|
|
|
35 |
identifying the plot lines.
|
|
|
36 |
</p></div><div class="refsect1"><a id="idp1378308260"></a><h2>History</h2><p>
|
|
|
37 |
In PHPlot-6.0, the term 'point shapes' was replaced with 'shape markers',
|
|
|
38 |
since PHPlot can now produce markers for line plots as well. (There was no
|
|
|
39 |
change to the behavior of <code class="function">SetLegendStyle</code> - only the
|
|
|
40 |
description changed.)
|
|
|
41 |
</p><p>
|
|
|
42 |
The option to use point shapes instead of color boxes in the legend
|
|
|
43 |
was added in PHPlot-5.4.0. See <a class="xref" href="SetLegendUseShapes.html" title="SetLegendUseShapes"><span class="refentrytitle">SetLegendUseShapes</span></a>.
|
|
|
44 |
In earlier releases, the <code class="literal">$colorbox_align</code> parameter to
|
|
|
45 |
<code class="function">SetLegendStyle</code> only applied to color boxes.
|
|
|
46 |
</p><p>
|
|
|
47 |
Through PHPlot-5.3.1, there was an optional third parameter
|
|
|
48 |
<code class="literal">$style</code>, which was intended for possible future use
|
|
|
49 |
but was never used. It was removed at PHPlot-5.4.0.
|
|
|
50 |
</p><p>
|
|
|
51 |
This function was added to PHPlot-5.0.4.
|
|
|
52 |
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetLegendReverse.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="SetLegendTextColor.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetLegendReverse </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetLegendTextColor</td></tr></table></div></body></html>
|