<?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: PROC SGPLOT with two x axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791663#M22511</link>
    <description>Thank you! It creates exactly what I was looking for.</description>
    <pubDate>Sat, 22 Jan 2022 20:07:46 GMT</pubDate>
    <dc:creator>dac_js</dc:creator>
    <dc:date>2022-01-22T20:07:46Z</dc:date>
    <item>
      <title>PROC SGPLOT with two x axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791605#M22507</link>
      <description>&lt;P&gt;I have two different datasets and want to create a plot with two line graph. The X and Y axis in these two datasets are different. Is it possible to add two X and two Y axis simultaneously in one graph. I found its possible to add two Y axis in PROC SGPLOT. Is there any way to do the same for two X axis using SGPLOT or other SAS procedures?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input&lt;BR /&gt;x1 y1;&lt;BR /&gt;datalines;&lt;BR /&gt;1 45&lt;BR /&gt;2 53&lt;BR /&gt;3 66&lt;BR /&gt;4 77&lt;BR /&gt;5 58&lt;BR /&gt;6 48&lt;BR /&gt;;&lt;BR /&gt;data have2;&lt;BR /&gt;input&lt;BR /&gt;x2 y2;&lt;BR /&gt;datalines;&lt;BR /&gt;1 15&lt;BR /&gt;2 16&lt;BR /&gt;3 27&lt;BR /&gt;4 30&lt;BR /&gt;5 35&lt;BR /&gt;6 45&lt;BR /&gt;7 40&lt;BR /&gt;8 37&lt;BR /&gt;9 44&lt;BR /&gt;10 45&lt;BR /&gt;11 56&lt;BR /&gt;12 45&lt;BR /&gt;13 95&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sgplot data=have;&lt;BR /&gt;series x=x1 y=y1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sgplot data=have2;&lt;BR /&gt;series x=x2 y=y2;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 23:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791605#M22507</guid>
      <dc:creator>dac_js</dc:creator>
      <dc:date>2022-01-21T23:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT with two x axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791614#M22508</link>
      <description>&lt;P&gt;First would be to combine the data sets.&lt;/P&gt;
&lt;P&gt;Depending upon the final desired appearance there a MANY options but this is a basic graph with both lines:&lt;/P&gt;
&lt;PRE&gt;data toplot;
   set have  (in=in1)
       have2 (in=in2)
   ;
run;

proc sgplot data=toplot;
   series x=x1 y=y1;
   series x=x2 y=y2;
run;&lt;/PRE&gt;
&lt;P&gt;Labels, axis controls, style settings for lines/markers might help make the result more usable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 01:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791614#M22508</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-22T01:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT with two x axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791634#M22509</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input
x1 y1;
datalines;
1 45
2 53
3 66
4 77
5 58
6 48
;
data have2;
input x2 y2;
datalines;
1 15
2 16
3 27
4 30
5 35
6 45
7 40
8 37
9 44
10 45
11 56
12 45
13 95
;

data want;
 merge have1 have2;
run;

proc sgplot data=want;
series x=x1 y=y1/lineattrs=(color=navy);
series x=x2 y=y2/x2axis y2axis lineattrs=(color=greenyellow);
xaxis valueattrs=(color=navy) labelattrs=(color=navy);
yaxis valueattrs=(color=navy) labelattrs=(color=navy);
x2axis valueattrs=(color=greenyellow) labelattrs=(color=greenyellow);
y2axis valueattrs=(color=greenyellow) labelattrs=(color=greenyellow);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1642849948260.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67624i9EEBA254F526A2D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1642849948260.png" alt="Ksharp_0-1642849948260.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 11:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791634#M22509</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-01-22T11:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT with two x axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791662#M22510</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 20:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791662#M22510</guid>
      <dc:creator>dac_js</dc:creator>
      <dc:date>2022-01-22T20:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT with two x axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791663#M22511</link>
      <description>Thank you! It creates exactly what I was looking for.</description>
      <pubDate>Sat, 22 Jan 2022 20:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-with-two-x-axis/m-p/791663#M22511</guid>
      <dc:creator>dac_js</dc:creator>
      <dc:date>2022-01-22T20:07:46Z</dc:date>
    </item>
  </channel>
</rss>

