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>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><code class="function">SetLegendStyle</code> controls the appearance of the legend,which is drawn if <a class="xref" href="SetLegend.html" title="SetLegend"><span class="refentrytitle">SetLegend</span></a> is used. The legendcontains of a series of text strings and either color boxes or shape markers,identifying the plot lines. SetLegendStyle sets the alignment ofthe text strings and color boxes or shapes markers. First the color boxes orshapes markers are aligned within the legend box, left or right, and then thetext strings are aligned within the remaining space, left or right.SetLegendStyle can also turn off the color boxes or shape markers.</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>A string indicating the alignment of the text strings: 'left' or 'right'.If 'left', the text strings are left-aligned between the legend box edgeand the color boxes or shape markers.If 'right', the text strings are right-aligned between the legend box edgeand the color boxes or shape markers.</p></dd><dt><span class="term"><em class="replaceable"><code>$colorbox_align</code></em></span></dt><dd><p>Optional string indicating the alignment of the color boxes or shape markers:'left', 'right', or 'none'.If 'left', they are drawn along the left side of the legend box.If 'right', they are drawn along the right side of the legend box.If 'none', no color boxes or shape markers are drawn.If this parameter is omitted, the same alignment as $text_align is used.</p></dd></dl></div></div><div class="refsect1"><a id="idp1378305204"></a><h2>Notes</h2><p>By default, the color boxes or shape markers are lined up along the right sideof the legend box, and the text strings are right-aligned just left of thecolor boxes or shape markers.The following figure shows the four possible alignment choices.</p><div class="informalfigure"><div class="mediaobject"><img src="images/legendstyle.png" alt="Four possible text/color box alignment choices" /></div></div><p></p><p>Using 'none' for $colorbox_align results in a legend with only text lines.This is not recommended for multi-line or multi-dataset plots, unless youhave provided some other way to indicate which legend text line goes withwhich plot, or if you are using the legend for some purpose other thanidentifying the plot lines.</p></div><div class="refsect1"><a id="idp1378308260"></a><h2>History</h2><p>In PHPlot-6.0, the term 'point shapes' was replaced with 'shape markers',since PHPlot can now produce markers for line plots as well. (There was nochange to the behavior of <code class="function">SetLegendStyle</code> - only thedescription changed.)</p><p>The option to use point shapes instead of color boxes in the legendwas added in PHPlot-5.4.0. See <a class="xref" href="SetLegendUseShapes.html" title="SetLegendUseShapes"><span class="refentrytitle">SetLegendUseShapes</span></a>.In earlier releases, the <code class="literal">$colorbox_align</code> parameter to<code class="function">SetLegendStyle</code> only applied to color boxes.</p><p>Through PHPlot-5.3.1, there was an optional third parameter<code class="literal">$style</code>, which was intended for possible future usebut was never used. It was removed at PHPlot-5.4.0.</p><p>This function was added to PHPlot-5.0.4.</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>