<?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: 2 datasets/series in one graph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255519#M9267</link>
    <description>&lt;P&gt;Hi Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for the help -&amp;nbsp; it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anette&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2016 14:00:38 GMT</pubDate>
    <dc:creator>AnetteD</dc:creator>
    <dc:date>2016-03-09T14:00:38Z</dc:date>
    <item>
      <title>2 datasets/series in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255464#M9264</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to make the attached graph in SAS - that is I want to make a proc gchart vbar on one dataset and a proc sqplot on&amp;nbsp;another dataset &amp;nbsp;and then combine the two graphs using proc greplay, but it just doesnt look pretty - does anybody have any other ideas ?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 09:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255464#M9264</guid>
      <dc:creator>AnetteD</dc:creator>
      <dc:date>2016-03-09T09:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: 2 datasets/series in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255486#M9265</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You combine the data that needs to be plotted into one data set using different varibale names, see below for an example&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2259iACB6C3403C680651/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="Capture.PNG" title="Capture.PNG" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You then can use the appropriate plot statements of Proc SGPLOT that are compatible with each other, for your example they are VBARPARM and SCATTER&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See also this blog entry &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2013/03/09/parametric-bar-charts/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/2013/03/09/parametric-bar-charts/&lt;/A&gt; by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a code sample that creates two tables with the data to be plotted, they are combined and then used with Proc SGPLOT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table carsAggr1 as
  select
    origin
    , type
    , mean(horsePower) as avg_horsePower
  from
    sashelp.cars

  group by
    origin
    , type
  ;
quit;

proc sql;
  create table carsAggr2 as
  select
    origin as origin2    
    , count(*) / (select count(*) from sashelp.cars) as share_pct format=percent9.1
  from
    sashelp.cars

  group by
    origin
  ;
quit;

data carsAggr3;
  set carsAggr1 carsAggr2;
  *
  * fill it, so we do not get an additional legend entry
  *;
  if type = " " then do;
    type = "SUV";
  end;
run;

proc sgplot data=carsAggr3;
  vbarparm category=Origin response=avg_horsePower / group=Type name="bar";
  scatter x=origin2 y=share_pct / 
    y2axis 
    markerattrs=(symbol= squarefilled)
    name="scatter"
    datalabel
    datalabelpos=top
  ;
  keylegend "bar" "scatter" / 
    location=outside
    position=right
    noborder
  ;
  y2axis values=(0 to 1.2 by 0.2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 09:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255486#M9265</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-03-09T09:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: 2 datasets/series in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255519#M9267</link>
      <description>&lt;P&gt;Hi Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for the help -&amp;nbsp; it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anette&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 14:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/2-datasets-series-in-one-graph/m-p/255519#M9267</guid>
      <dc:creator>AnetteD</dc:creator>
      <dc:date>2016-03-09T14:00:38Z</dc:date>
    </item>
  </channel>
</rss>

