<?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 gplot-2 vars in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962991#M25384</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to do&amp;nbsp; plot of 2 vars.&lt;/P&gt;
&lt;P&gt;The axis var is numeric with format YYMM.&lt;/P&gt;
&lt;P&gt;What is the way to see in x-axis the values:&amp;nbsp; 2201 till 2302&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input YYMM Y :percent8.2;
format y percent8.2;
cards;
2201 0.18%
2202 0.19%
2203 0.22%
2204 0.04%
2205 0.23%
2206 0.27%
2207 0.26%
2208 0.04%
2209 0.06%
2210 0.09%
2211 0.03%
2212 0.04%
2301 0.03%
2302 5.3%
;
Run;
data have2;
set have;
sasdate = input(put(YYMM,4.),yymmn4.);
format  sasdate yymmn4.;
Run;
proc gplot data=have2;
plot y*YYMM/ 
                        vaxis=0 to 0.1 by 0.01
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 31 Mar 2025 09:14:13 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2025-03-31T09:14:13Z</dc:date>
    <item>
      <title>proc gplot-2 vars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962991#M25384</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to do&amp;nbsp; plot of 2 vars.&lt;/P&gt;
&lt;P&gt;The axis var is numeric with format YYMM.&lt;/P&gt;
&lt;P&gt;What is the way to see in x-axis the values:&amp;nbsp; 2201 till 2302&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input YYMM Y :percent8.2;
format y percent8.2;
cards;
2201 0.18%
2202 0.19%
2203 0.22%
2204 0.04%
2205 0.23%
2206 0.27%
2207 0.26%
2208 0.04%
2209 0.06%
2210 0.09%
2211 0.03%
2212 0.04%
2301 0.03%
2302 5.3%
;
Run;
data have2;
set have;
sasdate = input(put(YYMM,4.),yymmn4.);
format  sasdate yymmn4.;
Run;
proc gplot data=have2;
plot y*YYMM/ 
                        vaxis=0 to 0.1 by 0.01
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Mar 2025 09:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962991#M25384</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-03-31T09:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc gplot-2 vars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962993#M25385</link>
      <description>&lt;P&gt;Please look at x-axis. I cannot see the x values well&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 09:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962993#M25385</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-03-31T09:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc gplot-2 vars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962996#M25386</link>
      <description>&lt;P&gt;Well, you have a couple problems - the main one is that you're not using you're newly created variable, SASDATE, in the GPLOT step - instead, you're using the original, unformatted version, YYMM.&amp;nbsp; You also might consider using SGPLOT rather than GPLOT to get more modern-looking graphics.&amp;nbsp; Also, since your data are longitudinal, it will probably be easier to visualize as a line (SERIES) rather than as a scatter plot.&amp;nbsp; Here's an extremely simple version:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=have2 noautolegend;
series x=sasdate y=Y;
scatter x=sasdate y=Y / markerattrs=(size=5 color=black symbol=circlefilled);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Mar 2025 11:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/962996#M25386</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-03-31T11:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc gplot-2 vars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/963007#M25387</link>
      <description>Can you please show me how to use it with my sas date var?&lt;BR /&gt;In x axis I want to see all my date values.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Mar 2025 14:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/963007#M25387</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-03-31T14:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc gplot-2 vars</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/975942#M25678</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length yymm $4;
input YYMM Y :percent8.2;
format y percent8.2;
datalines;
2201 0.18%
2202 0.19%
2203 0.22%
2204 0.04%
2205 0.23%
2206 0.27%
2207 0.26%
2208 0.04%
2209 0.06%
2210 0.09%
2211 0.03%
2212 0.04%
2301 0.03%
2302 5.3%
;

data want; set have;
length date_string $8;
date_string='20'||trim(left(yymm))||'15';
format  sasdate yymmn4.;
sasdate = input(date_string,yymmdd8.);

proc print data=want; 
format sasdate date9.;

axis1 label=none minor=none offset=(0,0) order=(0 to .1 by .01);
axis2 label=('YYMM') offset=(2pct,2pct)
 order=('15jan2022'd to '15feb2023'd by month);

symbol1 value=circle height=2pct color=blue;

title1 h=5pct "Values, by Month";

proc gplot data=want;
format y percentn7.0;
plot y*sasdate/
 autovref lvref=33 cvref=gray33
 vaxis=axis1
 haxis=axis2
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yymm.png" style="width: 800px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110228i430E7D0AE05071C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="yymm.png" alt="yymm.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 13:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-gplot-2-vars/m-p/975942#M25678</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2025-09-29T13:30:24Z</dc:date>
    </item>
  </channel>
</rss>

