<?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 how can I get the x and y axes equal in length? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200311#M7457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - I am trying to produce scatter plots (4 per page in a PDF file) such that they are "square" rather than "rectangular" in shape (i.e. the x-axis is equal in length to the y-axis).&amp;nbsp; How can I make SAS do this (version 9.4) ?&amp;nbsp; Below is an example of the code for the 1st graph that appears in the top left corner of the page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS PDF FILE="F:\graphs1_4.pdf";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ods layout start;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ods region x=0.25 in y=1.5 in width=3.75 in height=3.75 in;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=cpet15 noautolegend;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis label="Time (min)";&lt;/P&gt;&lt;P&gt;&amp;nbsp; yaxis label="VE (L/min)";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; scatter x=t15_c_min y=ex_ve / MARKERATTRS= (symbol=circlefilled color=black size=3pt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter x=t15_c_min y=noex_ve / MARKERATTRS= (symbol=circle color=black size=3pt);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods layout end;&lt;/P&gt;&lt;P&gt;ods pdf close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2015 17:59:32 GMT</pubDate>
    <dc:creator>rileynic</dc:creator>
    <dc:date>2015-07-10T17:59:32Z</dc:date>
    <item>
      <title>how can I get the x and y axes equal in length?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200311#M7457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - I am trying to produce scatter plots (4 per page in a PDF file) such that they are "square" rather than "rectangular" in shape (i.e. the x-axis is equal in length to the y-axis).&amp;nbsp; How can I make SAS do this (version 9.4) ?&amp;nbsp; Below is an example of the code for the 1st graph that appears in the top left corner of the page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS PDF FILE="F:\graphs1_4.pdf";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ods layout start;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ods region x=0.25 in y=1.5 in width=3.75 in height=3.75 in;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=cpet15 noautolegend;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis label="Time (min)";&lt;/P&gt;&lt;P&gt;&amp;nbsp; yaxis label="VE (L/min)";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; scatter x=t15_c_min y=ex_ve / MARKERATTRS= (symbol=circlefilled color=black size=3pt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter x=t15_c_min y=noex_ve / MARKERATTRS= (symbol=circle color=black size=3pt);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods layout end;&lt;/P&gt;&lt;P&gt;ods pdf close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 17:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200311#M7457</guid>
      <dc:creator>rileynic</dc:creator>
      <dc:date>2015-07-10T17:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the x and y axes equal in length?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200312#M7458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at the ASPECT= option in PROC SGPLOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 18:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200312#M7458</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-07-10T18:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the x and y axes equal in length?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200313#M7459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way to get a "real" equated plot is to use the GTL LayoutEquated container.&amp;nbsp; This will give you a graph where the mapping of the data to pixels on x and y axis are equal.&amp;nbsp; This is not hard.&amp;nbsp; Here is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc template;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define statgraph equated;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begingraph;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entrytitle 'Blood Pressure';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; layout overlayequated&lt;/STRONG&gt; / xaxisopts=(griddisplay=on)&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxisopts=(griddisplay=on);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scatterplot x=systolic y=diastolic;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endgraph;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgrender data=sashelp.heart template=equated;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A "poor man's" Equated plot can be obtained by using ASPECT option on SGPLOT procedure.&amp;nbsp; Note, this only makes the wall of equal size, but the actual pixel to data mapping may not be exactly equal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=sashelp.heart &lt;STRONG&gt;aspect=1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter x=systolic y=diastolic;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis grid;&lt;/P&gt;&lt;P&gt;&amp;nbsp; yaxis grid;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice in the first (GTL) graph, the axis tick interval is equal (50 units) on both axes and the number of pixels per grid is equal.&amp;nbsp; &lt;/P&gt;&lt;P&gt;In the second graph (SG), the wall is square, but the data spans about 200 units along x and about 100 units about Y.&amp;nbsp; The tick intervals are not equal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 18:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200313#M7459</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-07-10T18:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the x and y axes equal in length?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200314#M7460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I beg to differ. It is "not hard" ONCE you master proc template! How many days of work does that take? And anyone revising your work in the future will also need to spend that learning time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless I am looking for something exotic, and a square graph area isn't that, I don't want to get into a new language layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 18:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200314#M7460</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-07-10T18:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the x and y axes equal in length?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200315#M7461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is perfectly reasonable to stay with the code you know.&amp;nbsp; As long as we understand that a plot with a square wall (equal X &amp;amp; Y axes lengths in pixels) is not same as an "Equated Plot".&amp;nbsp; An "Equated Plot" has the same mapping of data to pixels on both axes.&amp;nbsp; This ensures that an overlaid lineparm with slope=1,will display at 45 degrees.&amp;nbsp;&amp;nbsp; Actual length of the axis need not be equal. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If what you want is an Equated Plot, you can approximate it with SGPLOT, as long as you ensure the data range on each axis is also in the same ratio as the ASPECT.&amp;nbsp; You should also watch out for axis offsets that are automatically set by the axis based on plot types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 19:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200315#M7461</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-07-10T19:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the x and y axes equal in length?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200316#M7462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - thanks so much for your help!&amp;nbsp; I was so set on making the graph "square" in the layout that I never even considered going back to the procedure to do it.&amp;nbsp; As it turns out, I am producing a number of graphs in this way, but the axes are never measured on the same scale, so the best solution for me is to use aspect=1 in the proc sgplot.&amp;nbsp; This worked like a charm for my situation &amp;amp; I really appreciate the discussion!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 02:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-get-the-x-and-y-axes-equal-in-length/m-p/200316#M7462</guid>
      <dc:creator>rileynic</dc:creator>
      <dc:date>2015-07-12T02:17:43Z</dc:date>
    </item>
  </channel>
</rss>

