<?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: Add a data table to a plot in PROC GPLOT in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8337#M355</link>
    <description>You can build it with annotate.</description>
    <pubDate>Thu, 19 Mar 2009 17:33:49 GMT</pubDate>
    <dc:creator>Flip</dc:creator>
    <dc:date>2009-03-19T17:33:49Z</dc:date>
    <item>
      <title>Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8335#M353</link>
      <description>Is there an option in PROC GPLOT or on the PLOT statement that will produce a table of plotted values below the graph, similar to the 'Add a Data Table' option when creating a chart in Excel?</description>
      <pubDate>Wed, 18 Mar 2009 20:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8335#M353</guid>
      <dc:creator>Petersi</dc:creator>
      <dc:date>2009-03-18T20:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8336#M354</link>
      <description>No such option in PROC GPLOT. However, PROC PRINT will product such a table.</description>
      <pubDate>Thu, 19 Mar 2009 17:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8336#M354</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2009-03-19T17:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8337#M355</link>
      <description>You can build it with annotate.</description>
      <pubDate>Thu, 19 Mar 2009 17:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8337#M355</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-03-19T17:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8338#M356</link>
      <description>Thanks.  I was actually just starting to put this together with Annotation, but was hoping there would be a simple option that would take care of this automatically.</description>
      <pubDate>Thu, 19 Mar 2009 17:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8338#M356</guid>
      <dc:creator>Petersi</dc:creator>
      <dc:date>2009-03-19T17:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8339#M357</link>
      <description>It is hard for me to imagine how ANNOTATE would be easier than PROC PRINT or PROC REPORT.</description>
      <pubDate>Thu, 19 Mar 2009 19:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8339#M357</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2009-03-19T19:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8340#M358</link>
      <description>Just prettier.&lt;BR /&gt;
And I am an old dog who has been doing it since before ODS was invented.</description>
      <pubDate>Thu, 19 Mar 2009 19:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8340#M358</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-03-19T19:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8341#M359</link>
      <description>Yes, I think I would agree with Paige, but I need the table packaged with the graph output in a .ps file.  I think I would still need Annotate to attach the PROC REPORT output in there.</description>
      <pubDate>Thu, 19 Mar 2009 19:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8341#M359</guid>
      <dc:creator>Petersi</dc:creator>
      <dc:date>2009-03-19T19:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8342#M360</link>
      <description>Hi:&lt;BR /&gt;
Annotate would place/position the information in the graphic image area. PRINT/REPORT would position the table outside the graph area -- as a separate, tabular object. If you used the ODS HTMLPANEL destination, you can place the image and the table side by side, or in two rows. But they would still be physically separate, the graphic image would not contain the data table. &lt;BR /&gt;
 &lt;BR /&gt;
There may be an alternative to Annotate, depending on the size of the data table. In SAS 9.2, you could use the SGPLOT procedure, which has an INSET statement. That allows placement, generally, of smaller tables. For example, this PROC SQL step gets the highest HIGH, the maximum CLOSE and the lowest LOW numbers and writes them with an INSET statement:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
  select max(close),&lt;BR /&gt;
         max(high),&lt;BR /&gt;
         min(low) into :maxclose, :maxhigh, :minlow&lt;BR /&gt;
  from sashelp.stocks&lt;BR /&gt;
  where (date &amp;gt;= "01jan2000"d and stock = "IBM");&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
                   &lt;BR /&gt;
%put maxclose=&amp;amp;maxclose maxhigh=&amp;amp;maxhigh minlow=&amp;amp;minlow;&lt;BR /&gt;
                &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc sgplot data=sashelp.stocks&lt;BR /&gt;
  (where=(date &amp;gt;= "01jan2000"d and stock = "IBM"));&lt;BR /&gt;
  title "Stock Trend"; &lt;BR /&gt;
    series x=date y=close;&lt;BR /&gt;
    series x=date y=low;&lt;BR /&gt;
    series x=date y=high;&lt;BR /&gt;
    inset ("Max Close" = "&amp;amp;maxclose" &lt;BR /&gt;
           "Highest High" = "&amp;amp;maxhigh" &lt;BR /&gt;
           "Lowest Low"=" &amp;amp;minlow") &lt;BR /&gt;
  / border  valuealign=left position=topright&lt;BR /&gt;
    title="Key Numbers"&lt;BR /&gt;
    titleattrs=GraphLabelText; &lt;BR /&gt;
run; &lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
In order to use the SG procedures, you must have SAS 9.2. For large data tables, with a lot of columns or many rows, the inset approach would not be effective since the text box is positioned -inside- the plot area.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 19 Mar 2009 20:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8342#M360</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-03-19T20:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8343#M361</link>
      <description>&amp;gt; Yes, I think I would agree with Paige, but I need the&lt;BR /&gt;
&amp;gt; table packaged with the graph output in a .ps file.&lt;BR /&gt;
&amp;gt; I think I would still need Annotate to attach the&lt;BR /&gt;
&amp;gt;  PROC REPORT output in there.&lt;BR /&gt;
&lt;BR /&gt;
ODS PS does exactly this. You create your graph in PROC GPLOT, you create your table in PROC PRINT or PROC REPORT, and magically, you have one output file containing both your plot and your table.</description>
      <pubDate>Fri, 20 Mar 2009 12:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8343#M361</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2009-03-20T12:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8344#M362</link>
      <description>See.  They are taking all the fun out of it.</description>
      <pubDate>Fri, 20 Mar 2009 12:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8344#M362</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-03-20T12:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8345#M363</link>
      <description>Hi:&lt;BR /&gt;
&lt;BR /&gt;
Since the original question was how to do something that you can do in Excel, I took that same "look/behavior" to be the requirement. When I make a chart in Excel and then insert a data table, the table appears IMMEDIATELY underneath the X axis of the chart, within the Excel "object" that holds the graph. Similar to the Equity Fund Example here:&lt;BR /&gt;
&lt;A href="http://robslink.com/SAS/democd17/funds.htm" target="_blank"&gt;http://robslink.com/SAS/democd17/funds.htm&lt;/A&gt; (which uses SAS, GPLOT and ANNOTATE)&lt;BR /&gt;
        &lt;BR /&gt;
When you use SAS to create images and route the images to ODS, the Images are converted to the "internal" format for PS, PDF and RTF -- So, for those destinations, unless you can edit the file, the image and table -will- stay together -- not because the table is physically inside the graph area, but because the PS file is the container that holds both objects. Images are placed in an external image file (pointed to by &amp;lt;IMG&amp;gt;) for HTML. For LaTeX, the images are put into PS files for inclusion in the LaTeX document.&lt;BR /&gt;
 &lt;BR /&gt;
  If you want ONE image with the data table "inside" the boundary of the image/graph area (as shown in the above example), then technically PROC PRINT or PROC REPORT don't fit the requirement because they place the graph in a table that is external to the graph image area. &lt;BR /&gt;
&lt;BR /&gt;
Even if you make a PS file that now contains the image and the table in a single file, you have to be able to USE or RENDER the PS file if anyone wants to LOOK at the output.  So, the PS file would have to be printed, viewed with GhostView, inserted into a LaTeX document (which might need further processing to be rendered and viewable) or distilled into PDF. &lt;BR /&gt;
&lt;BR /&gt;
Bob Allison's link is an excellent site with lots of good SAS/Graph and some ODS Graphics examples. He uses ANNOTATE extensively and has posted ALL the code that goes with his graph examples.&lt;BR /&gt;
&lt;A href="http://robslink.com/SAS/Home.htm" target="_blank"&gt;http://robslink.com/SAS/Home.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 20 Mar 2009 14:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8345#M363</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-03-20T14:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8346#M364</link>
      <description>&amp;gt; Since the original question was how to do something&lt;BR /&gt;
&amp;gt; that you can do in Excel, I took that same&lt;BR /&gt;
&amp;gt; "look/behavior" to be the requirement. &lt;BR /&gt;
&lt;BR /&gt;
Digressing momentarily, I opine that using SAS/GRAPH to emulate the look and feel of Excel graphics is one of the stupidest and most pointless things people can do. Excel graphics are poorly designed to convey information ... just ask any graphics design expert.</description>
      <pubDate>Fri, 20 Mar 2009 16:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8346#M364</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2009-03-20T16:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add a data table to a plot in PROC GPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8347#M365</link>
      <description>Hi, Paige:&lt;BR /&gt;
  I am frequently puzzled by the amount of time, money and energy that people spend trying to make SAS/ODS output look like something that they can do in Excel. But I've also learned that sometimes folks just aren't ready to break the umbilical cord to Mother Microsoft.&lt;BR /&gt;
  &lt;BR /&gt;
  I took a course from Edward Tufte a few years back and realized that in order to create some of his classic graphs, you would end up using ANNOTATE a lot. Bob Allison's web site shows a lot of graphs that are "Tufte-esque" and he also participates in Dashboard Spy discussions (or at least some of his graph examples have been mentioned on Dashboard Spy).&lt;BR /&gt;
&lt;A href="http://dashboardspy.wordpress.com/2006/06/16/sales-dashboard-screenshot-using-sasgraph-to-track-sales-and-marketing-metrics/" target="_blank"&gt;http://dashboardspy.wordpress.com/2006/06/16/sales-dashboard-screenshot-using-sasgraph-to-track-sales-and-marketing-metrics/&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://sas.weblogsinc.com/2006/06/27/tips-sass-allison-guest-stars-on-dashboard-spy/" target="_blank"&gt;http://sas.weblogsinc.com/2006/06/27/tips-sass-allison-guest-stars-on-dashboard-spy/&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
and, here's a DM artical by Stephen Few about Bob's winning DM Review graph:&lt;BR /&gt;
&lt;A href="http://www.perceptualedge.com/articles/dmreview/intelligent_dashboard.pdf" target="_blank"&gt;http://www.perceptualedge.com/articles/dmreview/intelligent_dashboard.pdf&lt;/A&gt;.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 20 Mar 2009 16:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-data-table-to-a-plot-in-PROC-GPLOT/m-p/8347#M365</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-03-20T16:35:23Z</dc:date>
    </item>
  </channel>
</rss>

