<?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: SGPLOT HighLow in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/493153#M16894</link>
    <description>&lt;P&gt;I tried to run your code and I don't get the correct legend indicated 'city' and 'highway' with two colors.&lt;/P&gt;&lt;P&gt;how to correct it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&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="mileage.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23059i3C838BC81984CEC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="mileage.png" alt="mileage.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Sep 2018 18:39:39 GMT</pubDate>
    <dc:creator>e75wez1</dc:creator>
    <dc:date>2018-09-06T18:39:39Z</dc:date>
    <item>
      <title>SGPLOT HighLow</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492447#M16878</link>
      <description>&lt;P&gt;I am having a hard time coming up with the graph that I posted below. The code that I have so far is posted below.&lt;/P&gt;&lt;P&gt;Can anyone help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;BR /&gt;proc means data=sashelp.cars min max mean median;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;class type origin;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var mpg_city;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ods output summary=cars;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=cars;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;highlow x=type low=mpg_city_min high=mpg_city_max / group=type&amp;nbsp; type=bar transparency=.3&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dataskin=pressed fillattrs=(color=cx66FF66) barwidth=.7;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;footnote j=left 'Across Vehicle Types';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23001i9BDC68CB9C1B6F1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="example1.PNG" alt="example1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 19:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492447#M16878</guid>
      <dc:creator>chrissowden</dc:creator>
      <dc:date>2018-09-04T19:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT HighLow</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492463#M16879</link>
      <description>&lt;P&gt;What characteristic is supposed to be used to determine the color? (Assuming getting the second color is the actual question).&lt;/P&gt;
&lt;P&gt;You appear to have something in mind but since you have type as both the x axis and group variable it is not clear.&lt;/P&gt;
&lt;P&gt;You are getting three data series: Asia, Europe and USA. If you meant to compare only two of them, as appear in your example then you need to either exclude one or possibly create a different dichotomous variable. You might want to say what the two groups in your example are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your example also has different width bars for each of the two groups. Since FILLATTRS and BARWIDTH only allow a single color/ width value perhaps you are looking for a DATTRMAP solution.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 19:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492463#M16879</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-04T19:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT HighLow</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492472#M16882</link>
      <description>&lt;P&gt;As others have indicated you have too much data you're trying to plot at once - primarily multiple origins. This means you have a value for each type of vehicle when you're only showing a single bar for each metric. So you either want to not consider Origin or have a plot for each origin.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, your data structure is a touch hard to work with. Changing it around, this works fine for me and the graph is pretty close to what you've shown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Simplify PROC MEANS to change output data and structure&lt;/P&gt;
&lt;P&gt;2. Add another highlow plot for second group (city vs highway)&lt;/P&gt;
&lt;P&gt;3. Change colors in second plot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
proc means data=sashelp.cars min max mean median nway noprint ;
    class type origin;
    var mpg_city mpg_highway;
    output out=cars min= max= /autoname autolabel;
run;


proc sgplot data=cars ;
where origin='Asia';   
    highlow x=type low=mpg_highway_min high=mpg_highway_max / group=type  type=bar transparency=.3
    dataskin=pressed fillattrs=(color=cx2c7fb8) barwidth=1;   

    highlow x=type low=mpg_city_min high=mpg_city_max / group=type  type=bar transparency=.3
    dataskin=pressed fillattrs=(color=cx66FF66) barwidth=.7;


    footnote j=left 'Across Vehicle Types';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130109"&gt;@chrissowden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am having a hard time coming up with the graph that I posted below. The code that I have so far is posted below.&lt;/P&gt;
&lt;P&gt;Can anyone help me out?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods listing close;&lt;BR /&gt;proc means data=sashelp.cars min max mean median;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;class type origin;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var mpg_city;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ods output summary=cars;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=cars;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;highlow x=type low=mpg_city_min high=mpg_city_max / group=type&amp;nbsp; type=bar transparency=.3&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dataskin=pressed fillattrs=(color=cx66FF66) barwidth=.7;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;footnote j=left 'Across Vehicle Types';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23001i9BDC68CB9C1B6F1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="example1.PNG" alt="example1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 20:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492472#M16882</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-04T20:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT HighLow</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492666#M16884</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.cars nway min max ;
    class type ;
    var mpg_city MPG_Highway;
    ods output summary=cars;
run;

 

proc sgplot data=cars;
    highlow x=type low=mpg_city_min high=mpg_city_max /   type=bar transparency=.5
    dataskin=pressed  barwidth=.7 fillattrs=graphdata1 nooutline;
    highlow x=type low=MPG_Highway_min high=MPG_Highway_max /   type=bar transparency=.5
    dataskin=pressed  barwidth=.7 fillattrs=graphdata2 nooutline;
    footnote j=left 'Across Vehicle Types';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Sep 2018 14:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/492666#M16884</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-05T14:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT HighLow</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/493153#M16894</link>
      <description>&lt;P&gt;I tried to run your code and I don't get the correct legend indicated 'city' and 'highway' with two colors.&lt;/P&gt;&lt;P&gt;how to correct it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&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="mileage.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23059i3C838BC81984CEC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="mileage.png" alt="mileage.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 18:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/493153#M16894</guid>
      <dc:creator>e75wez1</dc:creator>
      <dc:date>2018-09-06T18:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT HighLow</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/493409#M16897</link>
      <description>&lt;P&gt;OK. Here is what I got.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.cars nway min max ;
    class type ;
    var mpg_city MPG_Highway;
    ods output summary=cars;
run;

 
title 'Gas range';
proc sgplot data=cars ;
    highlow x=type low=MPG_Highway_min high=MPG_Highway_max /   type=bar transparency=.5
    dataskin=pressed  barwidth=.6 fillattrs=(color=blue) nooutline legendlabel='HighWay' name='b';
    highlow x=type low=mpg_city_min high=mpg_city_max /   type=bar transparency=.5
    dataskin=pressed  barwidth=.8 fillattrs=(color=green) nooutline legendlabel='City' name='a';
keylegend 'a' 'b' / location=inside   position=ne ;
yaxis min=0 label='MPG';
    footnote j=left 'Across Vehicle Types';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23081i1E9EB2484B4C53BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="x.png" alt="x.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 13:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-HighLow/m-p/493409#M16897</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-07T13:28:33Z</dc:date>
    </item>
  </channel>
</rss>

