<?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 proc sgplot with 2 y axes in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453729#M15556</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a plot with two y axes. I used proc sgplot and I see the graph generated with color and symbol representation for only one y axis. Is there any way or option to show the color and symbol representation for another Y axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data temp;
input ptno ady value1 value2;
cards;
100 1 10 12
100 5 15 16
100 8 20 18
;


ods listing;
proc sgplot data=temp;
scatter x=ady y=value1/group=ptno;
scatter x=ady y=value2/y2axis group=ptno;
yaxis min=0 label='Y1 axis' values=(0 to 20 by 2);
y2axis min=0 label='Y2 axis' values=(0 to 20 by 2);
run;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Apr 2018 19:50:42 GMT</pubDate>
    <dc:creator>shari</dc:creator>
    <dc:date>2018-04-12T19:50:42Z</dc:date>
    <item>
      <title>proc sgplot with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453729#M15556</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a plot with two y axes. I used proc sgplot and I see the graph generated with color and symbol representation for only one y axis. Is there any way or option to show the color and symbol representation for another Y axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data temp;
input ptno ady value1 value2;
cards;
100 1 10 12
100 5 15 16
100 8 20 18
;


ods listing;
proc sgplot data=temp;
scatter x=ady y=value1/group=ptno;
scatter x=ady y=value2/y2axis group=ptno;
yaxis min=0 label='Y1 axis' values=(0 to 20 by 2);
y2axis min=0 label='Y2 axis' values=(0 to 20 by 2);
run;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 19:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453729#M15556</guid>
      <dc:creator>shari</dc:creator>
      <dc:date>2018-04-12T19:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453755#M15558</link>
      <description>&lt;P&gt;I'm not entirely sure of what you want, but I think you might want separate legends for each plot. Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input ptno ady value1 value2;
cards;
100 1 10 12
100 5 15 16
100 8 20 18
;

ods listing;
proc sgplot data=temp;
scatter x=ady y=value1/group=ptno name="v1";
scatter x=ady y=value2/y2axis group=ptno name="v2";
keylegend "v1" / title="Y Axis" position=bottomleft;
keylegend "v2" / title="Y2 Axis" position=bottomright;
yaxis min=0 label='Y1 axis' values=(0 to 20 by 2);
y2axis min=0 label='Y2 axis' values=(0 to 20 by 2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 20:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453755#M15558</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-04-12T20:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453805#M15564</link>
      <description>Thank you. It worked as expected. Sorry for not being much clear.&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Apr 2018 00:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-with-2-y-axes/m-p/453805#M15564</guid>
      <dc:creator>shari</dc:creator>
      <dc:date>2018-04-13T00:38:53Z</dc:date>
    </item>
  </channel>
</rss>

