<?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: BARCHART/SCATTERPLOT combination - any way to stop bars &amp;quot;floating&amp;quot; above x axis line? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337483#M11732</link>
    <description>&lt;P&gt;That did the trick - thank you for the quick reply!&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 18:11:14 GMT</pubDate>
    <dc:creator>Rachel1</dc:creator>
    <dc:date>2017-03-02T18:11:14Z</dc:date>
    <item>
      <title>BARCHART/SCATTERPLOT combination - any way to stop bars "floating" above x axis line?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337440#M11727</link>
      <description>&lt;P&gt;I have a combination&amp;nbsp;BARCHART/SCATTERPLOT in GTL (EG 7.1/9.4). I've noticed for this combination that there's some sort of padding going on such that the y and y2 minimum values and hence the bars automatically float&amp;nbsp;up a bit instead of&amp;nbsp;sitting right on the x axis line as they do when not combined with the SCATTERPLOT. It's probably easier to understand visually so I attached a simplified version of the floating situation plus the same graph with the SCATTERPLOT statement commented out to illustrate the normal situation. Here's the applicable code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table work.cars as

	select distinct Make, mean(MSRP) as Avg_MSRP, mean(MPG_CITY) as Avg_MPG
		from sashelp.cars
			where Origin = 'Europe'
				Group by Make;
run;
quit;

proc template;
	define statgraph test;
		begingraph / backgroundcolor=white border=false;
			layout overlay / walldisplay=none
				xaxisopts=(display=(line tickvalues ))
				yaxisopts=(display =(label tickvalues ticks)) 
				y2axisopts=(display=(label tickvalues));
				barchart x=Make y=Avg_MSRP;
				scatterplot x=Make y=Avg_MPG /yaxis=y2; /*comment this out to get the normal situation*/
			endlayout;
		endgraph;
	end;
run;

proc sgrender data=work.cars template=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After playing with this for a while, I think I understand why this happens&amp;nbsp;- the padding enables enough room for the SCATTERPLOT markers since otherwise they could be positioned right on or under the x axis line, which wouldn't look good.So I'm assuming this is a "working as designed" sort of thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure this seems like a minor issue, but - the x axis line is a brand standard requirement (otherwise I would just take it out), and a few of our users think the "floating bars" look sort of funny, especially when seen next to a graph where this does not happen. So my question is if there is any way to force the bars down to sit right on the x axis line in this sort of combination.&amp;nbsp;I've played with many different options, but nothing so far has had the desired effect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13513iC3C4D5823DF7224B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="not_floating.png" title="not_floating.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13514i70FDB2D47CD03D8A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="floating.png" title="floating.png" /&gt;</description>
      <pubDate>Thu, 02 Mar 2017 16:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337440#M11727</guid>
      <dc:creator>Rachel1</dc:creator>
      <dc:date>2017-03-02T16:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: BARCHART/SCATTERPLOT combination - any way to stop bars "floating" above x axis line?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337455#M11729</link>
      <description>&lt;P&gt;You are exactly right about why the bars are "floating" when overlaid with a scatter plot. &amp;nbsp;Markers and lines generate an "offset" of the amount needed to ensure that a marker on the edge does not get clipped by half. &amp;nbsp;However, if you are sure none of your markers are near the edge, you can use OFFSETMIN=0 and OFFSETMAX=0 on the x and y axes to get rid of the offset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With newer plot statement like TEXT, we added a CONTRIBUTEOFFSET option that allows you to control&amp;nbsp;if and where offsets should be added.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, with SGPLOT, we make the default x-axis Fit Policy is&amp;nbsp;"split Rotate". &amp;nbsp;This splits the tick values on white space to give you better arrangement. &amp;nbsp;However, for GTL, you have to set it. &amp;nbsp;Personally, I prefer split tick values instead of the long rotated ones.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 17:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337455#M11729</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-03-02T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: BARCHART/SCATTERPLOT combination - any way to stop bars "floating" above x axis line?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337483#M11732</link>
      <description>&lt;P&gt;That did the trick - thank you for the quick reply!&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 18:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BARCHART-SCATTERPLOT-combination-any-way-to-stop-bars-quot/m-p/337483#M11732</guid>
      <dc:creator>Rachel1</dc:creator>
      <dc:date>2017-03-02T18:11:14Z</dc:date>
    </item>
  </channel>
</rss>

