<?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: Change color of bars in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155174#M5791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lizi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with Sanjay regarding the useful information to include. i.e. the version number of SAS, and please see the tip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing that you need to include the following within your SCATTERPLOT statement to change the color of the bars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ERRORBARATTRS = (color = red) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also choose other colors apart from red.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2015 15:40:51 GMT</pubDate>
    <dc:creator>djrisks</dc:creator>
    <dc:date>2015-02-05T15:40:51Z</dc:date>
    <item>
      <title>Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155172#M5789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the very first time I am using SAS to do a customized chart. I have SAS 9.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to draw confidence intervals in gplot and find the thread &lt;A __default_attr="112874" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/" modifiedtitle="true" title="Drawing confidence intervals in gplot using annotate. "&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I bascially followed Sanjay's codes like.&lt;/P&gt;&lt;PRE lang="sas" style="font-size: 13px; font-family: monospace;"&gt;proc template;&amp;nbsp;&amp;nbsp; define statgraph errorbars;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begingraph;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entrytitle 'Product Revenue';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay / yaxisopts=(offsetmin=0) xaxisopts=(display=(ticks tickvalues line));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; barchart x=product y=revenue;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scatterplot x=product y=revenue / yerrorupper=upper yerrorlower=lower markerattrs=(size=0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endgraph;&amp;nbsp;&amp;nbsp; end; run; &lt;/PRE&gt;&lt;P&gt;But, I cannot figure out how to change the color of the bars. Can anyone tell me how to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my data:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="263"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="71"&gt;days&lt;/TD&gt;&lt;TD width="64"&gt;Mean&lt;/TD&gt;&lt;TD width="64"&gt;Upper&lt;/TD&gt;&lt;TD width="64"&gt;Lower&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;0 day&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;34.36&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;31.97&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;36.76&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;1-3 days&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;37.75&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;33.87&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;41.64&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;4-7 days&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;42.69&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;38.43&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;46.96&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&amp;gt;7 days&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;48.60&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;43.07&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;54.12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"days" is my x-axis, and "Mean" is the variable I want to plot for a bar chart, with 95% CI of upper and lower values.&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lizi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155172#M5789</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-02-05T15:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155173#M5790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is always useful to include the Version number of SAS you are using, as the answer depends on that information.&amp;nbsp; Preferably, include a full working program with sample data you have already built. SGPLOT may be sufficient for you needs.&amp;nbsp; Please see&amp;nbsp; &lt;A __default_attr="10106" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155173#M5790</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-02-05T15:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155174#M5791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lizi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with Sanjay regarding the useful information to include. i.e. the version number of SAS, and please see the tip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing that you need to include the following within your SCATTERPLOT statement to change the color of the bars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ERRORBARATTRS = (color = red) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also choose other colors apart from red.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155174#M5791</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-02-05T15:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155175#M5792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I'll keep that in my mind. I have SAS 9.3. I also just added some sample data in my question. Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155175#M5792</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-02-05T15:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155176#M5793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Dirisks! I tried including &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; ERRORBARATTRS = (color = red) at the end of the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;SCATTERPLOT statement. It looks there is no error message, but I do not see the bar color change.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155176#M5793</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-02-05T15:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155177#M5794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have SAS 9.3 or later, you can do this using the SGPLOT procedure.&lt;/P&gt;&lt;P&gt;Use LIMITATTRS to change the color of the error bars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change the color of the bars themselves using FILLATTRS.&amp;nbsp; SGPLOT has very extensive features and you can see product documentation for all the details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title 'Revenue by Product';&lt;/P&gt;&lt;P&gt;proc sgplot data=error;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbarparm category=product response=revenue / limitupper=upper limitlower=lower&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; limitattrs=(color=red);&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis display=(nolabel);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Bar_Error_SG.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9039_Bar_Error_SG.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155177#M5794</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-02-05T15:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155178#M5795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note: VBARPARM draws the data as you provide it &lt;STRONG&gt;without any summarization&lt;/STRONG&gt;.&amp;nbsp; It is designed for pre summarized data by category, and allows you to specify your own error limits.&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If you have two observations for "Desks", a second bar will be drawn over the first one for "Desks".&amp;nbsp;&amp;nbsp; You will see a log message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If you want the statement to summarize data, use VBAR, but you will then get the error bars based on the other statement options.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 16:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155178#M5795</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-02-05T16:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155179#M5796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sanjay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one more question: is it possible to change the font of x-axis(Desks, Chairs, Lamps) /y-axis (0, ...,2000) labels? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 16:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155179#M5796</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-02-05T16:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change color of bars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155180#M5797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most things can be customized.&amp;nbsp; See VALUEATTRS or LABELATTRS on the axis statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Blog has many examples of SGPLOT usage:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" title="http://blogs.sas.com/content/graphicallyspeaking/"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 16:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-color-of-bars/m-p/155180#M5797</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-02-05T16:24:50Z</dc:date>
    </item>
  </channel>
</rss>

