Data visualization with SAS programming

Can SAS plot more than 36 points on X-axis

Reply
Occasional Contributor
Posts: 8

Can SAS plot more than 36 points on X-axis

Hi Experts,

I have a data which has 48 rows, (at times it may go higher than 48). These 48 rows are basically months of last 4 years. When I try to plot them in SAS it is not plotting more than 36 months. I could group by years and plot 12 months on x axis, but the trend needs to be continious and all months need to come in a line.

Any help would be much appreciated.

Thanks!

Arimitra Maiti

SAS Super FREQ
Posts: 864

Re: Can SAS plot more than 36 points on X-axis

Can you show us a code snippet of your current approach? What version of SAS are you using?

Occasional Contributor
Posts: 8

Re: Can SAS plot more than 36 points on X-axis

SAS 4.3.

proc gplot data=trend_months;

plot fpm * month_number = yearnum_c/ overlay 

cframe=white haxis=axis1 vaxis=axis2 annotate=anno_all

autovref LVREF=1 CVREF=bgr wvref=1;

format month_number dataord.
FPM &s_format;

run;

quit; The dataset month_number has all distinct month numbers from 1 to 48. It is showing fine till 36, as I am using the first letter of evcery month and then annotating. Did I confuse you? Apologies.

SAS Super FREQ
Posts: 864

Re: Can SAS plot more than 36 points on X-axis

You might need to force 1 through 48 to appear on the axis by using the ORDER= option on the AXIS statement:

axis1 order=(1 to 48);

proc gplot data=trend_months;

plot fpm * month_number = yearnum_c/ overlay

cframe=white haxis=axis1 vaxis=axis2 annotate=anno_all

autovref LVREF=1 CVREF=bgr wvref=1;

format month_number dataord.
FPM &s_format;

run;

Occasional Contributor
Posts: 8

Re: Can SAS plot more than 36 points on X-axis

Many Thanks Dan. I am able to create what I intended. All my best wishes and many thanks for helping and enhancing me.

Post a Question
Discussion Stats
  • 4 replies
  • 323 views
  • 4 likes
  • 2 in conversation