<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can I create a legend in &amp;quot;proc sgplot&amp;quot; ? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132224#M5133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not clear how you represent the "observation values" in your graph, but I have a couple of thoughts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If each bar represents an observation, you can create a separate column containing the descriptions that lines up with your "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Geschlecht&lt;/SPAN&gt;" variable values and assign it to the GROUP option on the VBAR statement. The legend will automatically show the descriptions.&lt;/P&gt;&lt;P&gt;2. If it is additional information that does not line up with the bar chart, consider using an INSET statement to add the information to the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2013 15:13:35 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2013-09-10T15:13:35Z</dc:date>
    <item>
      <title>Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132220#M5129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used "proc sgplot" to create a bar chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to complete it with a legend, but I can't find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found examples for "proc gplot", but I don't want to change all of my work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;proc sgplot data=Grafik;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; Title "Stabdiagramm der Variable: Geschlecht";&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; yaxis label="Absolute Häufigkeit";&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; xaxis label="Geschlecht der Studierenden";&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; vbar Geschlecht / barwidth=0.3;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; run;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the support!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 10:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132220#M5129</guid>
      <dc:creator>DaLack</dc:creator>
      <dc:date>2013-09-09T10:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132221#M5130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can, but I think you may need to use PROC TEMPLATE/PROC SGRENDER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code example:&lt;/P&gt;&lt;P&gt;proc template;&lt;/P&gt;&lt;P&gt;define statgraph sgdesign;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begingraph;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; entrytitle halign=center 'Type in your title...';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; entryfootnote halign=left 'Type in your footnote...';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; barchart x=SEX y=HEIGHT / name='bar' clusterwidth=1.0 fillattrs=(color=CXA4A5A4 );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; discretelegend 'bar' / opaque=false border=true halign=left valign=bottom displayclipped=true across=1 order=rowmajor location=inside;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;endgraph;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;1111&lt;/P&gt;&lt;P&gt;proc sgrender data=SASHELP.CLASS template=sgdesign;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 11:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132221#M5130</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-09-09T11:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132222#M5131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;SGPLOT will automatically create a legend when needed.&amp;nbsp; Since you don't have any group variable or other features, there is no need for a legend.&amp;nbsp; However, if you want, you can add a KEYLEGEND statement of your own, with a reference to a name of the plot.&amp;nbsp; Please see product documentation. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 11:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132222#M5131</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2013-09-09T11:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132223#M5132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the support!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have the problem, that I used numbers for the obsvervation values of a nominal variable.&lt;BR /&gt;Now I want to add a "description", where I can explain, what each number means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I look forward to the answer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 07:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132223#M5132</guid>
      <dc:creator>DaLack</dc:creator>
      <dc:date>2013-09-10T07:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132224#M5133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not clear how you represent the "observation values" in your graph, but I have a couple of thoughts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If each bar represents an observation, you can create a separate column containing the descriptions that lines up with your "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Geschlecht&lt;/SPAN&gt;" variable values and assign it to the GROUP option on the VBAR statement. The legend will automatically show the descriptions.&lt;/P&gt;&lt;P&gt;2. If it is additional information that does not line up with the bar chart, consider using an INSET statement to add the information to the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 15:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132224#M5133</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2013-09-10T15:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132225#M5134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for the ideas !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INSET statement works well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have a problem with the size of&amp;nbsp; the bar chart-box. My description is too big for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps their is an alternative to make the bar chart-box greater or to put the description outside of the graph.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 17:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132225#M5134</guid>
      <dc:creator>DaLack</dc:creator>
      <dc:date>2013-09-10T17:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a legend in "proc sgplot" ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132226#M5135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best alternative for putting them outside the graph is to use multiple FOOTNOTE statements. To make the graph itself bigger, you can use the WIDTH and HEIGHT options on the ODS GRAPHICS statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 17:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-I-create-a-legend-in-quot-proc-sgplot-quot/m-p/132226#M5135</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2013-09-10T17:53:05Z</dc:date>
    </item>
  </channel>
</rss>

