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 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
|
.ig >>
<STYLE TYPE="text/css">
<!--
A:link{text-decoration:none}
A:visited{text-decoration:none}
A:active{text-decoration:none}
OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }
H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>ploticus: proc legendentry</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550><tr>
<td>
<table cellpadding=2 width=550><tr>
<td><br><h2>proc legendentry</h2></td>
<td align=right>
<small>
<a href="../doc/welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
Version 2.33 Jun'06
</small><br><a href="../doc/scripthome.html">Scripts</a>
<td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>
.TH proc_legendentry PL "02-JUN-2006 PL ploticus.sourceforge.net"
.LP
Explicitly defines one legend entry.
This entry will be rendered the next time that
\fBproc legend\fR is executed.
Usually, legends are built by successive plotting procs
having a \fClegendlabel\fR attribute. However, if additional
flexibility is needed to make custom legend entries, this
proc may be invoked, once per legend entry.
.LP
For example, if a scatterplot is being created with various sized
points, there is no automatic way to get a legend of the various
point sizes, so \fBproc legendentry\fR could be executed (probably several
times) to define legend information, then \fBproc legend\fR could be
executed to render it.
.LP
\fBproc legendentry\fR is also useful in setting up
.ig >>
<a href="#legenddriven">
.>>
\0legend-driven plots
.ig >>
</a>
.>>
which allow things like bar color, or scatterplot symbol color, size, or
shape to be controlled by a data field.
.LP
A gallery example that uses this proc is
.ig >>
<a href="../gallery/scatterplot3a.html">
.>>
\0scatterplot3a.
.ig >>
</a>
.>>
.ig >>
<br><br><br>
.>>
.SH Attributes
.LP
\fBsampletype\fR
.ig >>
.>>
\fIt\fR
.IP \0
The type of sample to be displayed with the entry.
\fIt\fR may be one of:
\fCline\fR, \fCcolor\fR, \fCsymbol\fR, \fCtext\fR, \fCline+symbol\fR, or \fCtext+symbol\fR.
It may also be \fCnone\fR, in order to insert spacing into the legend.
.br
Example: \fCsampletype: text\fR
.ig >>
<br><br>
.>>
.LP
\fBlabel\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#text">
.>>
\0text
.ig >>
</a>
.>>
.IP \0
The label for the legend entry.
The \fC\\n\fR construct can be used to force a line break when the legend is displayed,
or the label can be wordwrapped using proc legend wraplen attribute.
.IP \0
Example 1: \fClabel: Eastern counties\fR
.IP \0
Example 2: \fClabel: Response curve \\n for 30 mg dose\fR
.ig >>
<br><br>
.>>
.LP
\fBtag\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#string">
.>>
\0string
.ig >>
</a>
.>>
.IP \0
An optional short identifier to be associated with the entry,
so that the entry can be accessed later.
Used with proc bars colorfield, as in this example:
.ig >>
<a href="../gallery/colorfld.htm">
.>>
\0colorfld
.ig >>
</a>
.>>
.ig >>
<br><br>
.>>
.LP
\fBdetails\fR
.ig >>
.>>
spec
.br
\fBdetails2\fR
.ig >>
.>>
spec
.br
\fBdetails3\fR
.ig >>
.>>
spec
.IP \0
Details regarding the rendering of the sample.
Exactly what should be supplied for \fCdetails\fR, \fCdetails2\fR and
perhaps \fCdetails3\fR depends on the \fCsampletype\fR:
.nf
sampletype details details2 details3
---------- ------------ ------------- -----------
line linedetails - -
color color - -
symbol symboldetails - -
text a char or word textdetails -
line+symbol linedetails symboldetails -
text+symbol a char or word textdetails symboldetails
.fi
Explanations of types:
.ig >>
<a href="color.html">
.>>
\0color
.ig >>
</a>
.>>
.ig >>
.>>
.ig >>
<a href="linedetails.html">
.>>
\0linedetails
.ig >>
</a>
.>>
.ig >>
.>>
.ig >>
<a href="symboldetails.html">
.>>
\0symboldetails
.ig >>
</a>
.>>
.ig >>
.>>
.ig >>
<a href="textdetails.html">
.>>
\0textdetails
.ig >>
</a>
.>>
.ig >>
<a name="legenddriven"></a>
.>>
.ig >>
<br><br><br>
.>>
.SH Legend-driven technique
.LP
This is a technique where
the legend table mechanism serves to map certain data values to ploticus
.ig >>
<a href="color.html">
.>>
\0colors
.ig >>
</a>
.>>
or other appearance attributes.
For example, suppose field 3 of your data is a group code of either A, B, or C.
You could use legend-driven technique to render 'A' data rows in red, 'B' in blue, and 'C' in green.
.LP
Here's how you do it:
.IP \0
1. For every expected variation,
set up an explicit legend entry using \fBproc legendentry\fR.
\fClabel\fR, \fCtag\fR, and \fCdetails\fR attributes should be supplied.
The \fCtag\fR will be compared with data field contents.
The \fCdetails\fR attributes control appearance.
.IP \0
2. Plot, using the appropriate attribute. For example, if you are
doing a bar graph where individual bar colors are controlled by a data
field, you would use \fBproc bars\fR and specify a \fCcolorfield\fR.
.LP
Examples of legend-driven technique are
.ig >>
<a href="../gallery/colorfld.htm">
.>>
\0colorfld
.ig >>
</a>
.>>
.ig >>
<a href="../gallery/symfld.htm">
.>>
\0symfld
.ig >>
</a>
.>>
.ig >>
<a href="../gallery/symfld.htm">
.>>
\0symfld
.ig >>
</a>
.>>
.ig >>
<a href="../gallery/dupsleg.htm">
.>>
\0dupsleg
.ig >>
</a>
.>>
.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="../doc/welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif">
</center>
</td></tr>
</table>
<br>
<center>
Ploticus is hosted at http://ploticus.sourceforge.net <br>
<img src="http://sourceforge.net/sflogo.php?group_id=38453" width="88" height="31" border="0" alt="SourceForge Logo">
</center>
.>>
|