<?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: Plot x-axis is not formatted in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466454#M16054</link>
    <description>&lt;P&gt;Interesting problem. There is an inconsistency in your variable names (you use X=P1 but set FORMAT P P.), but that doesn't seem to be the issue. For anyone interested in looking into this issue, here is some sample data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
do S = 1 to 2;
   do A = 0 to 85 by 5;
      do P = 1976 to 2011 by 5;
         rate = A + P; output;
      end;
   end;
end;
run;

ods graphics / height=800 width=1800;
proc sgpanel data=mydata(where=(A&amp;gt;30));
panelby S/novarname onepanel LAYOUT=panel columns=2 ROWHEADERPOS=right COLHEADERPOS=both SKIPEMPTYCELLS;
series y=rate x=P/ group=A lineattrs=(pattern=solid) lineattrs=(thickness=2);
keylegend/title="AGE GROUPS" position=right;
format A A. S S. P P.;
colaxis label='YEAR OF DIAGNOSIS' fitpolicy=rotate;
rowaxis label='INCIDENCE RATE, per 100,000' grid;
title1 "INCIDENCE RATE";
title2 "BY YEAR OF DIAGNOSIS AND AGE";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 31 May 2018 14:04:52 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-05-31T14:04:52Z</dc:date>
    <item>
      <title>Plot x-axis is not formatted</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466430#M16053</link>
      <description>&lt;P&gt;Is there any way to force the plot to take up on formatting on X-axis display? I'd like to show x axis as formatted for P as a range of time periods. S=Gender and A-Age formats taken up no problem. Do you know why and how to fix it? &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas support.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20892i4E87DDF585B1E968/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas support.png" alt="sas support.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value P
1976="1976-1980"
1981="1981-1985"
1986="1986-1990"
1991="1991-1995"
1996="1996-2000"
2001="2001-2005"
2006="2006-2010"
2011="2011-2015"
;
value A
0 ="0-4"
5 ="5-9"
10="10-14"
15="15-19"
20="20-24"
25="25-29"
30="30-34"
35="35-39"
40="40-44"
45="45-49"
50="50-54"
55="55-59"
60="60-64"
65="65-69"
70="70-74"
75="75-79"
80="80-84"
85="Over85"
;
value S
1="Male"
2="Female";
;
run;

ods graphics / height=800 width=1800;
proc sgpanel data=mydata(where=(A&amp;gt;30));
panelby S/novarname onepanel LAYOUT=panel columns=2 ROWHEADERPOS=right COLHEADERPOS=both SKIPEMPTYCELLS;
series y=rate x=P/ group=A lineattrs=(pattern=solid) lineattrs=(thickness=2);
keylegend/title="AGE GROUPS" position=right;
format A A. S S. P P.;
colaxis label='YEAR OF DIAGNOSIS' fitpolicy=thin valuesformat=best4.0 values=(1980 to 2016 by 1);
rowaxis label='INCIDENCE RATE, per 100,000' grid;
title1 "INCIDENCE RATE";
title2 "BY YEAR OF DIAGNOSIS AND AGE";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 14:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466430#M16053</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-05-31T14:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Plot x-axis is not formatted</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466454#M16054</link>
      <description>&lt;P&gt;Interesting problem. There is an inconsistency in your variable names (you use X=P1 but set FORMAT P P.), but that doesn't seem to be the issue. For anyone interested in looking into this issue, here is some sample data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
do S = 1 to 2;
   do A = 0 to 85 by 5;
      do P = 1976 to 2011 by 5;
         rate = A + P; output;
      end;
   end;
end;
run;

ods graphics / height=800 width=1800;
proc sgpanel data=mydata(where=(A&amp;gt;30));
panelby S/novarname onepanel LAYOUT=panel columns=2 ROWHEADERPOS=right COLHEADERPOS=both SKIPEMPTYCELLS;
series y=rate x=P/ group=A lineattrs=(pattern=solid) lineattrs=(thickness=2);
keylegend/title="AGE GROUPS" position=right;
format A A. S S. P P.;
colaxis label='YEAR OF DIAGNOSIS' fitpolicy=rotate;
rowaxis label='INCIDENCE RATE, per 100,000' grid;
title1 "INCIDENCE RATE";
title2 "BY YEAR OF DIAGNOSIS AND AGE";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 14:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466454#M16054</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-05-31T14:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Plot x-axis is not formatted</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466486#M16055</link>
      <description>&lt;P&gt;I think what you want here is a VLINE chart, not a SERIES plot. The axis for the SERIES is continuous by default, which is probably why the format did not show up. Also, the nature of your format is going to require some kind of aggregation (probably mean). Try replacing the SERIES statement with this statement and see if you get what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vline p / response=rate group=A stat=mean lineattrs=(pattern=solid) lineattrs=(thickness=2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 14:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466486#M16055</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-05-31T14:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Plot x-axis is not formatted</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466501#M16056</link>
      <description>&lt;P&gt;In addition&amp;nbsp;to the plot type issues I think you have defined your P format incorrectly to begin with.&lt;/P&gt;
&lt;P&gt;I think you intended&lt;/P&gt;
&lt;PRE&gt;proc format;
value P
1976 - 1980="1976-1980"
&amp;lt;etc&amp;gt;&lt;/PRE&gt;
&lt;P&gt;if you wanted a grouping format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And since you seem to want to combine the values then perhaps you should do that in a separate summary procedure or data step to create the appropriate Y axis value(s) using the P format to group the years. Since you have a rate displayed you probably cannot get the graphing procedure to combine things across years correctly (averaging rates in general yield incorrect results unless the denominator is identical for each and every group of data).&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 15:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-x-axis-is-not-formatted/m-p/466501#M16056</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-31T15:10:18Z</dc:date>
    </item>
  </channel>
</rss>

