<?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 In SGPANEL, interaction between PROPORTIONAL and OFFSETMIN/MAX in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983105#M25795</link>
    <description>&lt;P&gt;I'm creating a vertical bar chart in SGPANEL, and I want to increase the "offset" within each panel, squeezing together the bars within a panel. If the x-axis is consistent across panels, then no problem, I just use the OFFSETMIN and OFFSETMAX options in the COLAXIS statement. But when I use the PROPORTIONAL option of the PANELBY statement due to differing x-axes, then the&amp;nbsp;OFFSETMIN/MAX options seem to get ignored. This interaction is not documented as far as I can tell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example, creating plots with two panels in one row. The first plot has the same x-axis across panels and works as desired. The second plot has different x-axes across panels and does not honor the offset options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data plotdata;
	call streaminit(123);
	do panel = 1, 2;
		do group = 'A', 'B', 'C';
			y = rand("Uniform", 0, 100);
			output;
		end;
	end;
run;

title1 "Plot with consistent x-axes across panels";
title2 "The bars are squeezed together just as I wanted";
proc sgpanel data=plotdata;
	panelby panel / rows=1 onepanel;
	vbarparm response=y category=group;
	%let offset = 0.3;
	colaxis offsetMin=&amp;amp;offset offsetMax=&amp;amp;offset;
run;

title1 "Plot with different x-axes across panels using PROPORTIONAL";
title2 "Oops! The bars are not squeezed together!";
proc sgpanel data=plotdata;
	where not (panel = 1 and group = 'C');
	panelby panel / rows=1 onepanel proportional uniscale=row;
	vbarparm response=y category=group;
	%let offset = 0.3;
	colaxis offsetMin=&amp;amp;offset offsetMax=&amp;amp;offset;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Plot with consistent x-axes -- looks good" style="width: 576px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113034iC34599EECAD811C6/image-dimensions/576x288?v=v2" width="576" height="288" role="button" title="SGPanel.png" alt="Plot with consistent x-axes -- looks good" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Plot with consistent x-axes -- looks good&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Plot with different x-axes -- offset does not work" style="width: 575px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113035i1C304FC6FAE6BCB8/image-dimensions/575x287?v=v2" width="575" height="287" role="button" title="SGPanel1.png" alt="Plot with different x-axes -- offset does not work" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Plot with different x-axes -- offset does not work&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the 2nd plot, I tried changing the PANELBY statement to use LAYOUT=COLUMNLATTICE, but this did not solve my issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;panelby panel / layout=columnlattice onepanel proportional uniscale=row;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a workaround to squeeze the bars together when using PROPORTIONAL? Thanks for any suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SAS 9.4 M6 in SAS Studio 3.8.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Feb 2026 21:30:35 GMT</pubDate>
    <dc:creator>dmuenz</dc:creator>
    <dc:date>2026-02-05T21:30:35Z</dc:date>
    <item>
      <title>In SGPANEL, interaction between PROPORTIONAL and OFFSETMIN/MAX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983105#M25795</link>
      <description>&lt;P&gt;I'm creating a vertical bar chart in SGPANEL, and I want to increase the "offset" within each panel, squeezing together the bars within a panel. If the x-axis is consistent across panels, then no problem, I just use the OFFSETMIN and OFFSETMAX options in the COLAXIS statement. But when I use the PROPORTIONAL option of the PANELBY statement due to differing x-axes, then the&amp;nbsp;OFFSETMIN/MAX options seem to get ignored. This interaction is not documented as far as I can tell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example, creating plots with two panels in one row. The first plot has the same x-axis across panels and works as desired. The second plot has different x-axes across panels and does not honor the offset options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data plotdata;
	call streaminit(123);
	do panel = 1, 2;
		do group = 'A', 'B', 'C';
			y = rand("Uniform", 0, 100);
			output;
		end;
	end;
run;

title1 "Plot with consistent x-axes across panels";
title2 "The bars are squeezed together just as I wanted";
proc sgpanel data=plotdata;
	panelby panel / rows=1 onepanel;
	vbarparm response=y category=group;
	%let offset = 0.3;
	colaxis offsetMin=&amp;amp;offset offsetMax=&amp;amp;offset;
run;

title1 "Plot with different x-axes across panels using PROPORTIONAL";
title2 "Oops! The bars are not squeezed together!";
proc sgpanel data=plotdata;
	where not (panel = 1 and group = 'C');
	panelby panel / rows=1 onepanel proportional uniscale=row;
	vbarparm response=y category=group;
	%let offset = 0.3;
	colaxis offsetMin=&amp;amp;offset offsetMax=&amp;amp;offset;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Plot with consistent x-axes -- looks good" style="width: 576px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113034iC34599EECAD811C6/image-dimensions/576x288?v=v2" width="576" height="288" role="button" title="SGPanel.png" alt="Plot with consistent x-axes -- looks good" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Plot with consistent x-axes -- looks good&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Plot with different x-axes -- offset does not work" style="width: 575px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113035i1C304FC6FAE6BCB8/image-dimensions/575x287?v=v2" width="575" height="287" role="button" title="SGPanel1.png" alt="Plot with different x-axes -- offset does not work" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Plot with different x-axes -- offset does not work&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the 2nd plot, I tried changing the PANELBY statement to use LAYOUT=COLUMNLATTICE, but this did not solve my issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;panelby panel / layout=columnlattice onepanel proportional uniscale=row;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a workaround to squeeze the bars together when using PROPORTIONAL? Thanks for any suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SAS 9.4 M6 in SAS Studio 3.8.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 21:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983105#M25795</guid>
      <dc:creator>dmuenz</dc:creator>
      <dc:date>2026-02-05T21:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: In SGPANEL, interaction between PROPORTIONAL and OFFSETMIN/MAX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983108#M25796</link>
      <description>&lt;P&gt;This should get you pretty close - there might be some trick to also hide the tick marks for the 'phantom' columns to the left and right, but if not, there are certainly hacks or things you could do with proc template, probably.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data plotdata;
call streaminit(123);
array T1 {4} $3 _temporary_ ('_A1', 'A1', 'B1', 'C1');
array T2 {5} $3 _temporary_ ('_A2', 'A2', 'B2', 'C2', 'D2');
panel=1;
do i=1 to dim(T1);
	group=T1[i];
	if i=1 or i=dim(T1) then y=0;
	else y=rand("uniform", 0, 100);
	output;
end;
panel=2;
do i=1 to dim(T2);
	group=T2[i];
	if i=1 or i=dim(T2) then y=0;
	else y=rand("uniform", 0, 100);
	output;
end;
keep panel group y;
run;

proc format;
value $fp
	"_A1", "_A2", "C1", "D2"='09'x
	;
run;

proc sgpanel data=plotdata;
	panelby panel / rows=1 onepanel proportional uniscale=row;
	vbarparm response=y category=group;
	%let offset = 0.3;
	colaxis 
		valuesformat=$fp.
		offsetMin=&amp;amp;offset offsetMax=&amp;amp;offset;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="quickbluefish_0-1770338338661.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113036i5C39E52B5B62F038/image-size/medium?v=v2&amp;amp;px=400" role="button" title="quickbluefish_0-1770338338661.png" alt="quickbluefish_0-1770338338661.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 00:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983108#M25796</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2026-02-06T00:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: In SGPANEL, interaction between PROPORTIONAL and OFFSETMIN/MAX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983113#M25797</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223320"&gt;@quickbluefish&lt;/a&gt;, I like your idea! This doesn't give me as much control over the offset size as I'd like (I'm very picky about my graphs), but it's better than what I had. To be clear, in your code the OFFSETMIN/MAX options still do not work, so you could remove them from your COLAXIS statement and get the same result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;colaxis valuesformat=$fp.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll keep this question open to see if other ideas pop up, but if not I'll accept your answer. Maybe I'll also report this as a bug to SAS.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 05:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983113#M25797</guid>
      <dc:creator>dmuenz</dc:creator>
      <dc:date>2026-02-06T05:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: In SGPANEL, interaction between PROPORTIONAL and OFFSETMIN/MAX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983116#M25798</link>
      <description>&lt;P&gt;That was supposed to be if you are using "proportional" option . You can not apply&amp;nbsp;OFFSETMIN/MAX to the different the panel with using PROC SGPANEL.&lt;/P&gt;
&lt;P&gt;1) You can plot these bar separated one by one and combine them together:&lt;/P&gt;
&lt;P&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)You can change the bar width to make it look better:&lt;/P&gt;
&lt;PRE&gt;title1 "Plot with different x-axes across panels using PROPORTIONAL";
title2 "Oops! The bars are not squeezed together!";
proc sgpanel data=plotdata;
	where not (panel = 1 and group = 'C');
	panelby panel / rows=1 onepanel proportional uniscale=row ;
	vbarparm response=y category=group /&lt;STRONG&gt;barwidth=0.4&lt;/STRONG&gt;;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Or make some dummy group values as quickbluefish did:&lt;/P&gt;
&lt;PRE&gt;data plotdata;
	call streaminit(123);
	do panel = 1, 2;
	  &lt;STRONG&gt;  group='_';y=0;output;&lt;/STRONG&gt;
		do group = 'A', 'B', 'C';
			y = rand("Uniform", 0, 100);
			output;
		end;
		&lt;STRONG&gt;group='-';y=0;output;&lt;/STRONG&gt;
	end;
run;


title1 "Plot with different x-axes across panels using PROPORTIONAL";
title2 "Oops! The bars are not squeezed together!";
proc sgpanel data=plotdata;
	panelby panel / rows=1 onepanel proportional uniscale=row ;
	vbarparm response=y category=group /grouporder=data nooutline;
	&lt;STRONG&gt;colaxis values=('_' 'A' 'B' 'C' '-') valuesdisplay=(' ' 'A' 'B' 'C' ' ');&lt;/STRONG&gt;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1770368916489.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113037i59823D2CAF87E45D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1770368916489.png" alt="Ksharp_0-1770368916489.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 09:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983116#M25798</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-02-06T09:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: In SGPANEL, interaction between PROPORTIONAL and OFFSETMIN/MAX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983124#M25800</link>
      <description>&lt;P&gt;Also, in case you don't know, the reason the tick labels (A, B, ... ) in the plot I made are displayed that way (one character) when the underlying data has values like "A1", "B1"... is because I guess '09'x in the right side of the format is interpreted as a one character symbol, so everything is getting truncated to one character by the format $fp.&amp;nbsp; If you needed to display the whole name, you should be able to just add the other values to the format, e.g., like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $fp
  "_A1", "_A2", "C1", "D2" = '09'x
"A1" = "A1"
"B1" = "B1"
"A2" = "A2"
...
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;And, unrelated, if you want to adjust the space between the bars, you can use the 'barwidth' option in the vbarparm statement.&amp;nbsp; A barwidth of 1 means no space between bars:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;VBARPARM .... / barwidth=1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Feb 2026 12:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/In-SGPANEL-interaction-between-PROPORTIONAL-and-OFFSETMIN-MAX/m-p/983124#M25800</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2026-02-06T12:40:55Z</dc:date>
    </item>
  </channel>
</rss>

