<?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: PROC SGPANEL: How to use independent Y-axis scales for different variables in a panel? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-How-to-use-independent-Y-axis-scales-for-different/m-p/985583#M25867</link>
    <description>&lt;P&gt;1)&lt;/P&gt;
&lt;P&gt;Nope.&lt;BR /&gt;If you want "keeping them in the same row" ,then you have to plot two graph and combine them together, check this blog:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2022/09/10/complex-layouts-using-the-sg-procedures/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/graphicallyspeaking/2022/09/10/complex-layouts-using-the-sg-procedures/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Otherwise you should stack up these two graphics to make they have Y-Axis separatedly .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;An alternative way is using GTL, check PROC TEMPLATE .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph lattice;
begingraph;
entrytitle "Car Performance Profile";
layout lattice / border=false pad=0 opaque=true
rows=1 columns=2 columngutter=3;
layout overlay;

barchart category=status1 response=value1 /yaxis=y group=status1 name="cars";

endlayout;
layout overlay;

barchart category=status2 response=value2 /yaxis=y group=status2;

endlayout;
sidebar;
discretelegend "cars";
endsidebar;
endlayout;
endgraph;
end;
run;


data Alive Dead;
 set sashelp.heart(obs=200 keep=status sex weight height);
 if status='Alive' then output Alive;
  else output Dead;
run;
data have;
 merge  alive(rename=(sex=status1 weight=value1))  dead(rename=(sex=status2 height=value2));
run;

proc sgrender data=have
template=lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2026-03-29 145430.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113937i8E4E9CFBB66DE79C/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2026-03-29 145430.png" alt="屏幕截图 2026-03-29 145430.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Mar 2026 09:33:51 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2026-03-28T09:33:51Z</dc:date>
    <item>
      <title>PROC SGPANEL: How to use independent Y-axis scales for different variables in a panel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-How-to-use-independent-Y-axis-scales-for-different/m-p/985549#M25865</link>
      <description>&lt;DIV&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;Hello everyone,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;I am struggling with a visualization issue in PROC SGPANEL. I want to plot two different variables (Soil Carbon Stock and Nitrogen Stock) side-by-side.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;The problem is that my Carbon values are around 80 Mg/ha, while Nitrogen values are around 7 Mg/ha. Since SGPANEL forces a uniform scale for the row, my Nitrogen bars become almost invisible.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;Is there any way to force independent Y-axis scales for each panel while keeping them in the same row?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;Here is a snippet of my current code:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;proc sgpanel data=Tabela_modelo noautolegend;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;where Variavel in ("C_stock" "N_stock");&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;panelby Variavel / columns=2 novarname spacing=10 onepanel uniscale=row ;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;styleattrs datacolors=(CX08306B CX08519C CX2171B5 CX4292C6 CX6BAED6 CX9ECAE1);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;vbarparm category=Cover_crop response=Estimate /&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;group=Cover_crop&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;groupdisplay=cluster&lt;/SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;colaxis display=(nolabel novalues);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;rowaxis label="Estimate" ;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="josuerodrigues_0-1774636975139.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113911i7BD283281AD007DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="josuerodrigues_0-1774636975139.png" alt="josuerodrigues_0-1774636975139.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Mar 2026 18:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-How-to-use-independent-Y-axis-scales-for-different/m-p/985549#M25865</guid>
      <dc:creator>josuerodrigues</dc:creator>
      <dc:date>2026-03-27T18:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPANEL: How to use independent Y-axis scales for different variables in a panel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-How-to-use-independent-Y-axis-scales-for-different/m-p/985583#M25867</link>
      <description>&lt;P&gt;1)&lt;/P&gt;
&lt;P&gt;Nope.&lt;BR /&gt;If you want "keeping them in the same row" ,then you have to plot two graph and combine them together, check this blog:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2022/09/10/complex-layouts-using-the-sg-procedures/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/graphicallyspeaking/2022/09/10/complex-layouts-using-the-sg-procedures/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Otherwise you should stack up these two graphics to make they have Y-Axis separatedly .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;An alternative way is using GTL, check PROC TEMPLATE .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph lattice;
begingraph;
entrytitle "Car Performance Profile";
layout lattice / border=false pad=0 opaque=true
rows=1 columns=2 columngutter=3;
layout overlay;

barchart category=status1 response=value1 /yaxis=y group=status1 name="cars";

endlayout;
layout overlay;

barchart category=status2 response=value2 /yaxis=y group=status2;

endlayout;
sidebar;
discretelegend "cars";
endsidebar;
endlayout;
endgraph;
end;
run;


data Alive Dead;
 set sashelp.heart(obs=200 keep=status sex weight height);
 if status='Alive' then output Alive;
  else output Dead;
run;
data have;
 merge  alive(rename=(sex=status1 weight=value1))  dead(rename=(sex=status2 height=value2));
run;

proc sgrender data=have
template=lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2026-03-29 145430.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113937i8E4E9CFBB66DE79C/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2026-03-29 145430.png" alt="屏幕截图 2026-03-29 145430.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2026 09:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-How-to-use-independent-Y-axis-scales-for-different/m-p/985583#M25867</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-03-28T09:33:51Z</dc:date>
    </item>
  </channel>
</rss>

