<?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: Drawing Shapes on a page in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/416230#M14280</link>
    <description>&lt;P&gt;You may find (or not) Annotation easier.&lt;/P&gt;
&lt;P&gt;The Xs and Ys from your data set are used by adding information around them, like function, color, style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what SAS/Graph annotations look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions vsize=10in hsize=8in dev=png;
ods pdf file="%sysfunc(pathname(WORK))\f.pdf" ;

data DRAW;
  length STYLE COLOR FUNCTION $8 TEXT $50;
  retain XSYS XYS '3' POS '5';

  STYLE='e'; COLOR='black';
  X=10; Y=20; FUNCTION='move'; output;  * Position in % of area ;
  X=30; Y=40; FUNCTION='bar';  output;  * Draw rectangle        ;
  X=10; Y=20; FUNCTION='bar';  output;  * Close rectangle       ;

  STYLE='e'; COLOR='black';
  X=50; Y=40; FUNCTION='move'; output;
  X=70; Y=20; FUNCTION='bar';  output;
  X=50; Y=40; FUNCTION='bar';  output;

  STYLE='"Arial"'; COLOR='red';         * Write text            ;
  X=60; Y=30; TEXT='test'; FUNCTION='label'; output;

run;
  
proc ganno annotate=DRAW;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 478px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16857iD3264E11EBA6E706/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2017 01:39:20 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-11-27T01:39:20Z</dc:date>
    <item>
      <title>Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414571#M14231</link>
      <description>&lt;P&gt;&amp;nbsp;I am working on a project which requires drawing multiple shapes and creating a .pdf file. The shapes will mostly be rectangles and the dimensions for each of the shapes are varied and contained in a dataset. Within the boundary of each shape I will need to add text. I am wondering what the best way is to render the shapes to a page and print to a .pdf file. I'm currently using SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an added question, I will need to maximize the shapes onto the paper. Any suggestions are greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 23:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414571#M14231</guid>
      <dc:creator>ldenney</dc:creator>
      <dc:date>2017-11-17T23:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414574#M14232</link>
      <description>&lt;P&gt;SGPLOT has POLYGON and TEXT statements.&amp;nbsp; You can use them.&amp;nbsp; Here is an example of shapes but not rectangles.&amp;nbsp; Scroll down for polygon examples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/10/19/fun-ods-graphics-drawing-rotating-impossible-triangle/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2017/10/19/fun-ods-graphics-drawing-rotating-impossible-triangle/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can learn about SGPLOT from the documentation and from here.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;support.sas.com/documentation/prod-p/grstat/9.4/en/PDF/odsbasicg.pdf&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 00:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414574#M14232</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-11-18T00:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414575#M14233</link>
      <description>&lt;P&gt;Interesting, something like a CONSORT diagram?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC CALIS can do path diagrams.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The more details you can provide the better we can direct you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What version of SAS are you using?&lt;/P&gt;
&lt;P&gt;Is this a template that needs to be designed once or are you designing a process that needs to be automoated?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There’s a macro for annotating rectangles and text that can be put can be put together to develop what you want, I suspect placement will be the issue though that’s a matter of math really.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS5300-2016.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings16/SAS5300-2016.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 00:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414575#M14233</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-18T00:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414578#M14234</link>
      <description>&lt;P&gt;SGPLOT POLYGON statement supports any shape that you can define as a polygon, and has a builtin LABEL option to place text at center of polygon, with many options.&amp;nbsp;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2013/12/24/new-polygon-plot/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2013/12/24/new-polygon-plot/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 02:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414578#M14234</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-11-18T02:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414877#M14246</link>
      <description>Hi Reeza -&lt;BR /&gt;&lt;BR /&gt;I am using SAS 9.4 and I am designing a process that needs to be automated. Basically putting rectangular measurements on the page (e.g. 4 1/2 inches by 7 inches) - It's not a graph or a diagram just a series of rectangles of varying dimensions.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My SAS skills are pretty basic so any code direction is much appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for your help and response!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Nov 2017 16:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/414877#M14246</guid>
      <dc:creator>ldenney</dc:creator>
      <dc:date>2017-11-20T16:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/416230#M14280</link>
      <description>&lt;P&gt;You may find (or not) Annotation easier.&lt;/P&gt;
&lt;P&gt;The Xs and Ys from your data set are used by adding information around them, like function, color, style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what SAS/Graph annotations look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions vsize=10in hsize=8in dev=png;
ods pdf file="%sysfunc(pathname(WORK))\f.pdf" ;

data DRAW;
  length STYLE COLOR FUNCTION $8 TEXT $50;
  retain XSYS XYS '3' POS '5';

  STYLE='e'; COLOR='black';
  X=10; Y=20; FUNCTION='move'; output;  * Position in % of area ;
  X=30; Y=40; FUNCTION='bar';  output;  * Draw rectangle        ;
  X=10; Y=20; FUNCTION='bar';  output;  * Close rectangle       ;

  STYLE='e'; COLOR='black';
  X=50; Y=40; FUNCTION='move'; output;
  X=70; Y=20; FUNCTION='bar';  output;
  X=50; Y=40; FUNCTION='bar';  output;

  STYLE='"Arial"'; COLOR='red';         * Write text            ;
  X=60; Y=30; TEXT='test'; FUNCTION='label'; output;

run;
  
proc ganno annotate=DRAW;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 478px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16857iD3264E11EBA6E706/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 01:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/416230#M14280</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-11-27T01:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Shapes on a page</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/416765#M14304</link>
      <description>Thank you! This gives me a place to start.&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Nov 2017 17:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Drawing-Shapes-on-a-page/m-p/416765#M14304</guid>
      <dc:creator>ldenney</dc:creator>
      <dc:date>2017-11-28T17:04:43Z</dc:date>
    </item>
  </channel>
</rss>

