<?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 SGPLOT VBAR: increase space between group (not by color) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-increase-space-between-group-not-by-color/m-p/867406#M23623</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to plot vbar with group option. The current results are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL NOPRINT;
	CREATE TABLE TEMP00 AS 
		SELECT MAKE, ORIGIN, COUNT(*) AS NUM, MEAN(INVOICE) AS  INVOICE, MEAN(MPG_CITY) AS MPG_CITY
			FROM SASHELP.CARS
				GROUP BY MAKE, ORIGIN
					HAVING (CALCULATED NUM)&amp;gt;10
						ORDER BY ORIGIN, (CALCULATED INVOICE);
QUIT;

PROC SGPLOT DATA=TEMP00;
	VBAR MAKE/ RESPONSE=INVOICE GROUP=ORIGIN NOOUTLINE  MISSING ;
	VLINE MAKE/ RESPONSE=MPG_CITY GROUP=ORIGIN  Y2AXIS LINEATTRS=(COLOR=CX9CBA5F PATTERN=SOLID THICKNESS=2PX)  
		MARKERATTRS=(SYMBOL=CIRCLEFILLED COLOR=CX9CBA5F) MARKERS MISSING;
	TITLE "Summary data by Make";
	Y2AXIS LABEL="Mean MPG City";
	YAXIS LABEL="Mean Invoice";
	XAXIS LABEL="Make" DISCRETEORDER=DATA;
	LABEL INVOICE="Mean Invoice" MPG_CITY="Mean MPG City";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sgplot.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82223i4D95549A089E61F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sgplot.png" alt="Sgplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The graph divides groups by color. What I want is a graph that divides the groups by distance. Please tell me how to do it.&lt;/P&gt;&lt;P&gt;Sincerely thank you,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 09:51:45 GMT</pubDate>
    <dc:creator>NguyenThanhTra</dc:creator>
    <dc:date>2023-03-31T09:51:45Z</dc:date>
    <item>
      <title>SGPLOT VBAR: increase space between group (not by color)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-increase-space-between-group-not-by-color/m-p/867406#M23623</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to plot vbar with group option. The current results are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL NOPRINT;
	CREATE TABLE TEMP00 AS 
		SELECT MAKE, ORIGIN, COUNT(*) AS NUM, MEAN(INVOICE) AS  INVOICE, MEAN(MPG_CITY) AS MPG_CITY
			FROM SASHELP.CARS
				GROUP BY MAKE, ORIGIN
					HAVING (CALCULATED NUM)&amp;gt;10
						ORDER BY ORIGIN, (CALCULATED INVOICE);
QUIT;

PROC SGPLOT DATA=TEMP00;
	VBAR MAKE/ RESPONSE=INVOICE GROUP=ORIGIN NOOUTLINE  MISSING ;
	VLINE MAKE/ RESPONSE=MPG_CITY GROUP=ORIGIN  Y2AXIS LINEATTRS=(COLOR=CX9CBA5F PATTERN=SOLID THICKNESS=2PX)  
		MARKERATTRS=(SYMBOL=CIRCLEFILLED COLOR=CX9CBA5F) MARKERS MISSING;
	TITLE "Summary data by Make";
	Y2AXIS LABEL="Mean MPG City";
	YAXIS LABEL="Mean Invoice";
	XAXIS LABEL="Make" DISCRETEORDER=DATA;
	LABEL INVOICE="Mean Invoice" MPG_CITY="Mean MPG City";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sgplot.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82223i4D95549A089E61F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sgplot.png" alt="Sgplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The graph divides groups by color. What I want is a graph that divides the groups by distance. Please tell me how to do it.&lt;/P&gt;&lt;P&gt;Sincerely thank you,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 09:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-increase-space-between-group-not-by-color/m-p/867406#M23623</guid>
      <dc:creator>NguyenThanhTra</dc:creator>
      <dc:date>2023-03-31T09:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR: increase space between group (not by color)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-increase-space-between-group-not-by-color/m-p/867414#M23624</link>
      <description>&lt;P&gt;if you don't mind disgusting [&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;] solution try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL NOPRINT;
	CREATE TABLE TEMP00 AS 
		SELECT MAKE, ORIGIN, COUNT(*) AS NUM, MEAN(INVOICE) AS  INVOICE, MEAN(MPG_CITY) AS MPG_CITY
			FROM SASHELP.CARS
				GROUP BY MAKE, ORIGIN
					HAVING (CALCULATED NUM)&amp;gt;10
						ORDER BY ORIGIN, (CALCULATED INVOICE);
QUIT;

data TEMP01;
  set TEMP00 end=eof;
  by ORIGIN notsorted;
  output;
  if last.ORIGIN and not EOF;
    INVOICE = .;
    MPG_CITY = .;
    i + 1;
    MAKE = repeat(" ", i) !! "12"x;
    output;
run;

PROC SGPLOT DATA=TEMP01;
	VBAR MAKE/ RESPONSE=INVOICE GROUP=ORIGIN NOOUTLINE  MISSING /*!*/ NOZEROBARS /*!*/  ;
	VLINE MAKE/ RESPONSE=MPG_CITY GROUP=ORIGIN  Y2AXIS LINEATTRS=(COLOR=CX9CBA5F PATTERN=SOLID THICKNESS=2PX)  
		MARKERATTRS=(SYMBOL=CIRCLEFILLED COLOR=CX9CBA5F) MARKERS MISSING;
	TITLE "Summary data by Make";
	Y2AXIS LABEL="Mean MPG City";
	YAXIS LABEL="Mean Invoice";
	XAXIS LABEL="Make" DISCRETEORDER=DATA;
	LABEL INVOICE="Mean Invoice" MPG_CITY="Mean MPG City";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1680258394501.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82224iD39AD1801BA1AFAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1680258394501.png" alt="yabwon_0-1680258394501.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 10:26:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-increase-space-between-group-not-by-color/m-p/867414#M23624</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-03-31T10:26:49Z</dc:date>
    </item>
  </channel>
</rss>

