1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Legend Properties (GNU Octave (version 6.2.0))</title>
<meta name="description" content="Legend Properties (GNU Octave (version 6.2.0))">
<meta name="keywords" content="Legend Properties (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Graphics-Object-Properties.html" rel="up" title="Graphics Object Properties">
<link href="Line-Properties.html" rel="next" title="Line Properties">
<link href="Axes-Properties.html" rel="prev" title="Axes Properties">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<span id="Legend-Properties"></span><div class="header">
<p>
Next: <a href="Line-Properties.html" accesskey="n" rel="next">Line Properties</a>, Previous: <a href="Axes-Properties.html" accesskey="p" rel="prev">Axes Properties</a>, Up: <a href="Graphics-Object-Properties.html" accesskey="u" rel="up">Graphics Object Properties</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="Legend-Properties-1"></span><h4 class="subsubsection">15.3.3.4 Legend Properties</h4>
<span id="index--Legend-PropertiesLegend-Properties"></span>
<p>Properties of <code>legend</code> objects (see <a href="Plot-Annotations.html#XREFlegend">legend</a>):
</p>
<dl compact="compact">
<dd>
<span id="XREFlegendautoupdate"></span><span id="index-legend-autoupdate"></span>
</dd>
<dt><code>autoupdate</code>: <code>"off"</code> | {<code>"on"</code>}</dt>
<dd><p>Control whether the number of legend items is updated automatically when objects are added to (or deleted from) the peer axes.
For example:
</p><div class="example">
<pre class="example">## Create a single plot with its legend.
figure ();
plot (1:10);
legend ("Slope 1");
## Add another plot and specify its displayname so that
## the legend is correctly updated.
hold on;
plot ((1:10) * 2, "displayname", "Slope 2");
## Stop automatic updates for further plots.
legend ("autoupdate", "off");
plot ((1:10) * 3);
</pre></div>
<span id="XREFlegendbox"></span><span id="index-legend-box"></span>
</dd>
<dt><code>box</code>: <code>"off"</code> | {<code>"on"</code>}</dt>
<dd><p>Control whether the legend has a surrounding box.
</p>
<span id="XREFlegendcolor"></span><span id="index-legend-color"></span>
</dd>
<dt><code>color</code>: colorspec, def. <code>[1 1 1]</code></dt>
<dd><p>Color of the legend background. See <a href="Colors.html">colorspec</a>.
</p>
<span id="XREFlegendedgecolor"></span><span id="index-legend-edgecolor"></span>
</dd>
<dt><code>edgecolor</code>: colorspec, def. <code>[0.1500 0.1500 0.1500]</code></dt>
<dd><p>Control the color of the legend outline.
</p>
<span id="XREFlegendfontangle"></span><span id="index-legend-fontangle"></span>
</dd>
<dt><code>fontangle</code>: <code>"italic"</code> | {<code>"normal"</code>}</dt>
<dd><p>Control whether the font is italic or normal.
</p>
<span id="XREFlegendfontname"></span><span id="index-legend-fontname"></span>
</dd>
<dt><code>fontname</code>: string, def. <code>"*"</code></dt>
<dd><p>Name of font used for text rendering. When setting this property, the text rendering engine will search for a matching font in your system. If none is found then text is rendered using a default sans serif font (same as the default <code>"*"</code> value).
</p>
<p>Programming Note: On systems that don’t use FontConfig natively (all but Linux), the font cache is built when Octave is installed. You will need to run <code>system ("fc-cache -fv")</code> manually after installing new fonts.
</p>
<span id="XREFlegendfontsize"></span><span id="index-legend-fontsize"></span>
</dd>
<dt><code>fontsize</code>: scalar, def. <code>9</code></dt>
<dd><p>Size of the font used for text rendering. See <a href="#XREFlegendfontunits">fontunits property</a>.
</p>
<span id="XREFlegendfontunits"></span><span id="index-legend-fontunits"></span>
</dd>
<dt><code>fontunits</code>: <code>"centimeters"</code> | <code>"inches"</code> | <code>"normalized"</code> | <code>"pixels"</code> | {<code>"points"</code>}</dt>
<dd><p>Units used to interpret the <code>"fontsize"</code> property.
</p>
<span id="XREFlegendfontweight"></span><span id="index-legend-fontweight"></span>
</dd>
<dt><code>fontweight</code>: <code>"bold"</code> | {<code>"normal"</code>}</dt>
<dd><p>Control the variant of the base font used for text rendering.
</p>
<span id="XREFlegendlocation"></span><span id="index-legend-location"></span>
</dd>
<dt><code>location</code>: <code>"best"</code> | <code>"bestoutside"</code> | <code>"east"</code> | <code>"eastoutside"</code> | <code>"none"</code> | <code>"north"</code> | {<code>"northeast"</code>} | <code>"northeastoutside"</code> | <code>"northoutside"</code> | <code>"northwest"</code> | <code>"northwestoutside"</code> | <code>"south"</code> | <code>"southeast"</code> | <code>"southeastoutside"</code> | <code>"southoutside"</code> | <code>"southwest"</code> | <code>"southwestoutside"</code> | <code>"west"</code> | <code>"westoutside"</code></dt>
<dd><p>Control the location of the legend.
</p>
<span id="XREFlegendnumcolumns"></span><span id="index-legend-numcolumns"></span>
</dd>
<dt><code>numcolumns</code>: scalar interger, def. <code>1</code></dt>
<dd><p>Control the number of columns used in the layout of the legend items. For example:
</p><div class="example">
<pre class="example">figure ();
plot (rand (30));
legend ("numcolumns", 3);
</pre></div>
<p>Setting <code>numcolumns</code> also forces the <code>numcolumnsmode</code> property to be set to <code>"manual"</code>.
</p>
<span id="XREFlegendorientation"></span><span id="index-legend-orientation"></span>
</dd>
<dt><code>orientation</code>: <code>"horizontal"</code> | {<code>"vertical"</code>}</dt>
<dd><p>Control whether the legend items are arranged vertically (column-wise) or horizontally (row-wise).
</p>
<span id="XREFlegendposition"></span><span id="index-legend-position"></span>
</dd>
<dt><code>position</code>: four-element vector</dt>
<dd><p>Specify the position of the legend excluding its title. The four elements of the vector are the coordinates of the lower left corner and width and height of the legend. Changing this property also switches the <code>"location"</code> to <code>"none"</code>.
</p>
<span id="XREFlegendstring"></span><span id="index-legend-string"></span>
</dd>
<dt><code>string</code>: string | cell array of strings</dt>
<dd><p>List of labels for the legend items. For example:
</p><div class="example">
<pre class="example">figure ();
plot (rand (20));
## Let legend choose names automatically
hl = legend ();
## Selectively change some names
str = get (hl, "string");
str(1:5:end) = "Garbage";
set (hl, "string", str);
</pre></div>
<span id="XREFlegendtextcolor"></span><span id="index-legend-textcolor"></span>
</dd>
<dt><code>textcolor</code>: colorspec, def. <code>[0 0 0]</code></dt>
<dd><p>Control the color of the text strings for legend items.
</p>
<span id="XREFlegendtitle"></span><span id="index-legend-title"></span>
</dd>
<dt><code>title</code>: graphics handle</dt>
<dd><p>Graphics handle of the title text object.
</p>
<span id="XREFlegendunits"></span><span id="index-legend-units"></span>
</dd>
<dt><code>units</code>: <code>"centimeters"</code> | <code>"characters"</code> | <code>"inches"</code> | {<code>"normalized"</code>} | <code>"pixels"</code> | <code>"points"</code></dt>
<dd><p>Units used to interpret the <code>"position"</code>, property.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Line-Properties.html" accesskey="n" rel="next">Line Properties</a>, Previous: <a href="Axes-Properties.html" accesskey="p" rel="prev">Axes Properties</a>, Up: <a href="Graphics-Object-Properties.html" accesskey="u" rel="up">Graphics Object Properties</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|