<?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: Desire multiple axis results on same graph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370661#M12806</link>
    <description>&lt;P&gt;Here are a couple of options for you to do straight overlays with GPLOT and SGPLOT. If you want secondary Y axis support, do what Paige said for GPLOT or use the Y2AXIS option on the "returns" SERIES plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Use the POINTLABEL option to label the plot points */
symbol1 interpol=join value=dot color=vibg height=1.3
pointlabel=(height=10pt '#sales');
symbol2 interpol=join value=dot color=red  height=1.3
pointlabel=(height=10pt '#RETURNS');
title1 'Using the POINTLABEL Option with GPLOT';
axis1 offset=(4,4) minor=none;
axis2 offset=(2,2) minor=none;

proc gplot data=a;
plot sales*month returns*month / overlay haxis=axis1 vaxis=axis2 noframe;
run;
quit;

/* The AXIS and SYMBOL statements do not apply here */
title1 'Using the DATALABEL Option with SGPLOT';
proc sgplot data=a;
series x=month y=sales / markers lineattrs=(color=vibg) markerattrs=(color=vibg symbol=circlefilled)
                         markerattrs=(color=vibg symbol=circlefilled) datalabel;
series x=month y=returns / markers lineattrs=(color=red) markerattrs=(color=red symbol=circlefilled)
                         markerattrs=(color=red symbol=circlefilled) datalabel;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Jun 2017 16:51:30 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2017-06-26T16:51:30Z</dc:date>
    <item>
      <title>Desire multiple axis results on same graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370654#M12804</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; MONTH SALES RETURNS;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;1 52 22&lt;/P&gt;
&lt;P&gt;2 16 17&lt;/P&gt;
&lt;P&gt;3 78 66&lt;/P&gt;
&lt;P&gt;4 14 10&lt;/P&gt;
&lt;P&gt;5 26 0&lt;/P&gt;
&lt;P&gt;6 31 12&lt;/P&gt;
&lt;P&gt;7 92 66&lt;/P&gt;
&lt;P&gt;8 19 9&lt;/P&gt;
&lt;P&gt;9 18 8&lt;/P&gt;
&lt;P&gt;10 22 14&lt;/P&gt;
&lt;P&gt;11 84 14&lt;/P&gt;
&lt;P&gt;12 93 23&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/* Use the POINTLABEL option to label the plot points */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;symbol1&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;interpol&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=join &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;value&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=dot &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;color&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=vibg &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;height&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1.3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;pointlabel&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;height&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'#sales'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/*symbol1 interpol=join value=dot color=vibg height=1.3&lt;/P&gt;
&lt;P&gt;pointlabel=(height=10pt '#RETURNS');*/&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title1&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'Using the POINTLABEL Option with GPLOT'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;axis1&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;offset&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;minor&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;none&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;axis2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;offset&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;minor&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;none&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;gplot&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=a;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;plot&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sales*month / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;haxis&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=axis1 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;vaxis&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=axis2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noframe&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;plot&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; RETURNS*month / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;haxis&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=axis1 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;vaxis&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=axis2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noframe&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;It produces two graphs, one for Sales*Month and Returns*Month where *=By.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I want to produce one grpah with sales and returns on the same graph.&amp;nbsp; I need the sales to be in green (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;color&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=vibg) and the returns in red,&amp;nbsp; I guess its &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;color&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=vibr.&amp;nbsp; I want to know how I would get both measures on the same graph&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 16:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370654#M12804</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2017-06-26T16:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Desire multiple axis results on same graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370657#M12805</link>
      <description>&lt;P&gt;Probably you want to use the PLOT2 command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;plot2 RETURNS*month / haxis=axis1 vaxis=axis2 noframe;&lt;/PRE&gt;
&lt;P&gt;and the SYMBOL2 command where you assing the&amp;nbsp;color vibr&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 16:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370657#M12805</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-26T16:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Desire multiple axis results on same graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370661#M12806</link>
      <description>&lt;P&gt;Here are a couple of options for you to do straight overlays with GPLOT and SGPLOT. If you want secondary Y axis support, do what Paige said for GPLOT or use the Y2AXIS option on the "returns" SERIES plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Use the POINTLABEL option to label the plot points */
symbol1 interpol=join value=dot color=vibg height=1.3
pointlabel=(height=10pt '#sales');
symbol2 interpol=join value=dot color=red  height=1.3
pointlabel=(height=10pt '#RETURNS');
title1 'Using the POINTLABEL Option with GPLOT';
axis1 offset=(4,4) minor=none;
axis2 offset=(2,2) minor=none;

proc gplot data=a;
plot sales*month returns*month / overlay haxis=axis1 vaxis=axis2 noframe;
run;
quit;

/* The AXIS and SYMBOL statements do not apply here */
title1 'Using the DATALABEL Option with SGPLOT';
proc sgplot data=a;
series x=month y=sales / markers lineattrs=(color=vibg) markerattrs=(color=vibg symbol=circlefilled)
                         markerattrs=(color=vibg symbol=circlefilled) datalabel;
series x=month y=returns / markers lineattrs=(color=red) markerattrs=(color=red symbol=circlefilled)
                         markerattrs=(color=red symbol=circlefilled) datalabel;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jun 2017 16:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Desire-multiple-axis-results-on-same-graph/m-p/370661#M12806</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-06-26T16:51:30Z</dc:date>
    </item>
  </channel>
</rss>

