<html> <head> <!-- This file has been generated by unroff 1.0, 03/11/09 12:56:16. --> <!-- Do not edit! --> <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.41 Mar2009 </small><br><a href="../doc/scripthome.html">Scripts</a> <td></tr></table> </td></tr> <td> <br> <br> <title>Manual page for proc_legendentry(PL)</title> </head> <body> <p> Explicitly defines one legend entry.<tt> </tt> This entry will be rendered the next time that <b>proc legend</b> is executed.<tt> </tt> Usually, legends are built by successive plotting procs having a <tt>legendlabel</tt> attribute. However, if additional flexibility is needed to make custom legend entries, this proc may be invoked, once per legend entry.<tt> </tt> <p> 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 <b>proc legendentry</b> could be executed (probably several times) to define legend information, then <b>proc legend</b> could be executed to render it.<tt> </tt> <p> <b>proc legendentry</b> is also useful in setting up <a href="#legenddriven"> legend-driven plots </a> which allow things like bar color, or scatterplot symbol color, size, or shape to be controlled by a data field.<tt> </tt> <p> A gallery example that uses this proc is <a href="../gallery/scatterplot3a.html"> scatterplot3a.<tt> </tt> </a> <br><br><br> <h2>Attributes</h2> <p> <b>sampletype</b> <i>t</i> <dl> <dt> <dd> The type of sample to be displayed with the entry.<tt> </tt> <i>t</i> may be one of: <tt>line</tt>, <tt>color</tt>, <tt>symbol</tt>, <tt>text</tt>, <tt>line+symbol</tt>, or <tt>text+symbol</tt>.<tt> </tt> It may also be <tt>none</tt>, in order to insert spacing into the legend.<tt> </tt> <br> Example: <tt>sampletype: text</tt> <br><br> </dl> <p> <b>label</b> <a href="attributetypes.html#text"> text </a> <dl> <dt> <dd> The label for the legend entry.<tt> </tt> The <tt>\n</tt> 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.<tt> </tt> <dt> <dd> Example 1: <tt>label: Eastern counties</tt> <dt> <dd> Example 2: <tt>label: Response curve \n for 30 mg dose</tt> <br><br> </dl> <p> <b>tag</b> <a href="attributetypes.html#string"> string </a> <dl> <dt> <dd> An optional short identifier to be associated with the entry, so that the entry can be accessed later.<tt> </tt> Used with proc bars colorfield, as in this example: <a href="../gallery/colorfld.htm"> colorfld </a> <br><br> </dl> <p> <b>details</b> spec <br> <b>details2</b> spec <br> <b>details3</b> spec <dl> <dt> <dd> Details regarding the rendering of the sample. Exactly what should be supplied for <tt>details</tt>, <tt>details2</tt> and perhaps <tt>details3</tt> depends on the <tt>sampletype</tt>: <pre> 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 </pre> Explanations of types: <a href="color.html"> color </a> <a href="linedetails.html"> linedetails </a> <a href="symboldetails.html"> symboldetails </a> <a href="textdetails.html"> textdetails </a> <a name="legenddriven"></a> <br><br><br> </dl> <h2>Legend-driven technique</h2> <p> This is a technique where the legend table mechanism serves to map certain data values to ploticus <a href="color.html"> colors </a> or other appearance attributes.<tt> </tt> For example, suppose field 3 of your data is a group code of either A, B, or C.<tt> </tt> You could use legend-driven technique to render 'A' data rows in red, 'B' in blue, and 'C' in green.<tt> </tt> <p> Here's how you do it: <dl> <dt> <dd> 1. For every expected variation, set up an explicit legend entry using <b>proc legendentry</b>.<tt> </tt> <tt>label</tt>, <tt>tag</tt>, and <tt>details</tt> attributes should be supplied.<tt> </tt> The <tt>tag</tt> will be compared with data field contents.<tt> </tt> The <tt>details</tt> attributes control appearance.<tt> </tt> <dt> <dd> 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 <b>proc bars</b> and specify a <tt>colorfield</tt>.<tt> </tt> </dl> <p> Examples of legend-driven technique are <a href="../gallery/colorfld.htm"> colorfld </a> <a href="../gallery/symfld.htm"> symfld </a> <a href="../gallery/symfld.htm"> symfld </a> <a href="../gallery/dupsleg.htm"> dupsleg </a> <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> <table><tr><td> Ploticus is hosted at http://ploticus.sourceforge.net</td><td> </td><td> <a href="http://sourceforge.net/projects/ploticus"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=38453&type=12" width="120" height="30" border="0" alt="Get ploticus data display engine at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> </td></tr></table> </center> <p><hr> Markup created by <em>unroff</em> 1.0, <tt> </tt> <tt> </tt>March 11, 2009. </body> </html>