<?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: Separate Y axis scales like GTL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Y-axis-scales-like-GTL/m-p/815668#M22871</link>
    <description>&lt;P&gt;A panel of plots typically puts the axes on a common scale. It looks like you want the Y axes to scale independently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To emulate the behavior of PROC SGPANEL, you can&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self" rel="nofollow noopener noreferrer"&gt;use the&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self" rel="nofollow noopener noreferrer"&gt;ODS LAYOUT GRIDDED&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self" rel="nofollow noopener noreferrer"&gt;statement to arrange a set of plots&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;that are produced by using PROC SGPLOT.&amp;nbsp; You can use the&amp;nbsp;&lt;BR /&gt;BY statement in PROC SGPLOT to produce a set of plots, each of which will have an independently scaled Y axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* use PROC SORT, if necessary, to sort the data by the BY group */

ods graphics on /reset width=3in height=5in;
ods layout gridded columns=2 advance=BYGroup column_gutter=5px;
proc sgplot data=dummy;
    by paramcd;
    vbar cat/response=n;
    format cat pctcat.;
run;
ods layout end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 10:34:34 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2022-05-30T10:34:34Z</dc:date>
    <item>
      <title>Separate Y axis scales like GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Y-axis-scales-like-GTL/m-p/815661#M22870</link>
      <description>&lt;P&gt;I used proc sgpanel to create multiple plots. I need to separate Y axis then the plot will be like the plot using GTL. Could proc sgpanel make it? (I know we can let COLUMN=1 to separate&amp;nbsp; Y axis, it it makes the two plots not in one row which is not same with the attached plot created by GTL ).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AIO_1-1653902965789.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71869i6003C7D451CE8E46/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AIO_1-1653902965789.png" alt="AIO_1-1653902965789.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My codes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;title "";


proc format;
    value pctcat
        1="&amp;gt;10%"
        2="&amp;gt;1% - 10%"
        3="&amp;gt;0.1 - 1%"
        4="&amp;lt;=0.1%"
    ;
run;

data dummy1;
    do paramcd="CD1", "CD2";
        do cat=1 to 4;
            output;
        end;
    end;
run;

data dummy;
    set dummy1;
    length cd1 cd2 $200;
    if paramcd="CD1" then cd1=put(cat,pctcat.);
    if paramcd="CD2" then cd2=put(cat,pctcat.);

    input n pct;
    pct=pct/100;
    datalines;
    57 53
    30 67
    42 60 
    58 91
    74 78
    32 90
    44 83
    61 93
    ;

run;
ods graphics on /reset width=6in height=5in;

proc sgpanel data=dummy pctlevel=graph;
    panelby paramcd/*/columns=1*/;
    vbar cat/response=n;
    format cat pctcat.;
run;

ods graphics off;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 09:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Separate-Y-axis-scales-like-GTL/m-p/815661#M22870</guid>
      <dc:creator>AIO</dc:creator>
      <dc:date>2022-05-30T09:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Y axis scales like GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Y-axis-scales-like-GTL/m-p/815668#M22871</link>
      <description>&lt;P&gt;A panel of plots typically puts the axes on a common scale. It looks like you want the Y axes to scale independently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To emulate the behavior of PROC SGPANEL, you can&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self" rel="nofollow noopener noreferrer"&gt;use the&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self" rel="nofollow noopener noreferrer"&gt;ODS LAYOUT GRIDDED&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self" rel="nofollow noopener noreferrer"&gt;statement to arrange a set of plots&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;that are produced by using PROC SGPLOT.&amp;nbsp; You can use the&amp;nbsp;&lt;BR /&gt;BY statement in PROC SGPLOT to produce a set of plots, each of which will have an independently scaled Y axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* use PROC SORT, if necessary, to sort the data by the BY group */

ods graphics on /reset width=3in height=5in;
ods layout gridded columns=2 advance=BYGroup column_gutter=5px;
proc sgplot data=dummy;
    by paramcd;
    vbar cat/response=n;
    format cat pctcat.;
run;
ods layout end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 10:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Separate-Y-axis-scales-like-GTL/m-p/815668#M22871</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-05-30T10:34:34Z</dc:date>
    </item>
  </channel>
</rss>

