<?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 Add a Frequency Table to a Plot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53508#M1836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank&amp;nbsp; you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For these plots, all tables will have 3 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer the table to be inside the axes, but if it is too much of a hassle, I may need to be more flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also prefer the box around the data, but again, I can be flexible here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will keep looking at SAS papers and play around with the different annotate variables.&amp;nbsp; I found a paper by Art Carpenter that may help out a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Feb 2012 18:47:10 GMT</pubDate>
    <dc:creator>djbateman</dc:creator>
    <dc:date>2012-02-14T18:47:10Z</dc:date>
    <item>
      <title>Add a Frequency Table to a Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53505#M1833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a waterfall plot using PROC GPLOT and the NEEDLE interpolation.&amp;nbsp; I want to display a frequency table on the plot (the table is created in the attached SAS code).&amp;nbsp; The table should be added to the bottom left corner of the plot and look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 30%; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Positive&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Negative&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Increased&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;40&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Stable&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;11&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Decreased&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;8&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can use an annotate dataset to add the table to the plot, but I have never used anno datasets and have no idea where to start.&amp;nbsp; I am having no luck trying to teach myself.&amp;nbsp; Can someone give me some help here?&amp;nbsp; I also only have SAS 9.1, so I cannot use the SG procedures, which I hear does this quite easily.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 15:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53505#M1833</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2012-02-14T15:38:19Z</dc:date>
    </item>
    <item>
      <title>Add a Frequency Table to a Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53506#M1834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A lot of nice examples, including the code, can be found on Robert Allison's page ( &lt;A href="http://robslink.com/SAS/Home.htm"&gt;http://robslink.com/SAS/Home.htm&lt;/A&gt; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look, e.g., at group 17.&amp;nbsp; One at the bottom left side of the page includes a table on the bottom left part of the output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 15:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53506#M1834</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-14T15:56:12Z</dc:date>
    </item>
    <item>
      <title>Add a Frequency Table to a Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53507#M1835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You can do things like this with annotate (using function='label'), but there's no easy cookie-cutter code that I can provide.&amp;nbsp; It all depends on the exact specifics of what you want...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the table always have 3 rows, or does it need to grow &amp;amp; shrink depending on how many 'bars' are in the waterfall chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want the table in the same png file, but beside the graph, or inside the axes of the graph?&amp;nbsp; If inside the axes, is there guaranteed to always be white-space there?&amp;nbsp; (Beside the graph, you can guarantee white-space by using an angled blank title on the left or right of the graph).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the table have to have boxes drawn around it, or could it be just the words? (just the words is much simpler).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some other examples with an annotated table, but none are exactly what you're wanting (just sort of randomly choosing a few - but none are really good simple/learning ones):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd21/elecgage_info.htm"&gt;http://robslink.com/SAS/democd21/elecgage_info.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd19/sfew_info.htm"&gt;http://robslink.com/SAS/democd19/sfew_info.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd33/subprime_info.htm"&gt;http://robslink.com/SAS/democd33/subprime_info.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd44/ex_29_info.htm"&gt;http://robslink.com/SAS/democd44/ex_29_info.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless you *reall/really* need to have the table sharing the same space as the graph, I would recommend putting the table under the graph (but on the same webpage) - then you can use a simple "proc print" (or other html table-creating procs).&amp;nbsp; These can really/truly be put together on the same webpage to look quite nice:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd29/robslink_info.htm"&gt;http://robslink.com/SAS/democd29/robslink_info.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 18:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53507#M1835</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2012-02-14T18:36:39Z</dc:date>
    </item>
    <item>
      <title>Add a Frequency Table to a Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53508#M1836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank&amp;nbsp; you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For these plots, all tables will have 3 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer the table to be inside the axes, but if it is too much of a hassle, I may need to be more flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also prefer the box around the data, but again, I can be flexible here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will keep looking at SAS papers and play around with the different annotate variables.&amp;nbsp; I found a paper by Art Carpenter that may help out a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 18:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53508#M1836</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2012-02-14T18:47:10Z</dc:date>
    </item>
    <item>
      <title>Add a Frequency Table to a Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53509#M1837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should get you started with the basics (column headers could be added, and annotated move/draw lines or poly/polycont polygons or move/box could be used to draw boxes around the text - it's all a matter of geometry and working out the coordinates):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data table;&lt;BR /&gt;category='Increased'; positive=40; negative=22; output;&lt;BR /&gt;category='Stable'; positive=11; negative=6; output;&lt;BR /&gt;category='Decreased'; positive=8; negative=4; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table; set table;&lt;BR /&gt;length text $20;&lt;BR /&gt;xsys='1'; ysys='1'; hsys='3'; when='a'; function='label';&lt;BR /&gt;y=95-_n_*5;&lt;BR /&gt;x=5; position='6'; text=trim(left(category)); output;&lt;BR /&gt;x=20; position='4'; text=trim(left(positive)); output;&lt;BR /&gt;x=25; position='4'; text=trim(left(negative)); output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gplot data=sashelp.class anno=anno_table;&lt;BR /&gt;plot height*weight;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 18:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53509#M1837</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2012-02-14T18:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Add a Frequency Table to a Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53510#M1838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to Robert's excellent example, using GPLOT and ANNOTATE, the SGPLOT procedure with the NEEDLE statement can come close. If you are using 9.2, you'd have to stick with the INSET statement. If you are in 9.3, then the SG procedures do have annotation capability. Using your WATERFALL dataset, you should be able to see what this looks like using SAS 9.2 or higher.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing style=listing;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=waterfall cycleattrs;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title 'Best Percent Change in Tumor Size';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; where brpercent^=.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; needle x=n y=brpercent / name='n1'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group=posneg lineattrs=(thickness=3 pattern=1);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; yaxis grid label='Percent Change in Tumor Size';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; xaxis type=linear values=(1 to 91 by 1)&amp;nbsp; display=none;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; keylegend 'n1' / across=1 position=topright location=inside noborder;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; inset "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pos Neg" &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Increased&amp;nbsp; 111 112" &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Stable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 221 222" &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Decreased 331 332" / position=bottomleft valuealign=left &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; border title="Inset Table 1";&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; inset ("Increased"="111" "Stable"="222" "Decreased"="333")/&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; position=bottom valuealign=left &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; border title='Inset Table 2';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 21:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-a-Frequency-Table-to-a-Plot/m-p/53510#M1838</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-02-14T21:11:24Z</dc:date>
    </item>
  </channel>
</rss>

