BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sks521
Quartz | Level 8

Hi folks,

 

I am using proc sgplot to plot two time-series trends and I want to get rid of axis labels because it displays whatever name I have for 'y=......' for the first time-series as y-axis label.

 

Can someone shed some light on this please?

 

thanks

S

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Like this?

 

data control2;
input Quarter  $ 1-9  Comparator  Intervention;
datalines
;
Jan-Mar12 0.10 0.22
Apr-Jun12 0.10 0.21
Jul-Sep12 0.15 0.42
Oct-Dec12 0.10 0.34
Jan-Mar13 0.05 0.29
Apr-Jun13 0.07 0.17
Jul-Sep13 0.10 0.36
Oct-Dec13 0.12 0.31
Jan-Mar14 0.09 0.22
Apr-Jun14 0.12 0.23
Jul-Sep14 0.11 0.24
Oct-Dec14 0.15 0.34
Jan-Mar15 0.10 0.21
Apr-Jun15 0.12 0.18
Jul-Sep15 0.10 0.33
Oct-Dec15 0.10 0.33
Jan-Mar16 0.08 0.16
Apr-Jun16 0.10 0.18
Jul-Sep16 0.11 0.28
Oct-Dec16 0.14 0.30
;
run;
* doing plots of the data by quarter;
PROC SGPLOT DATA = control2;

 SERIES X = Quarter Y = Comparator;
 series x=Quarter y=Intervention;
 TITLE 'Quarterly time-series of perentage of asthma visits in under 2 and 2-16 year olds, Bradford';

 yaxis label='Percentage';
RUN; 

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Can you show us your code please?

sks521
Quartz | Level 8

Here you go. In this example, the first series I have has y=comparator so it will pick 'comparator' as y-axis label. while I want to label the y-axis as 'percentage'.

*Plotting quarterly asthma visits by age (comparing under 2 with 2-16 years) in Bradford only;
data control2;
input Quarter :$10.  Comparator  Intervention;
datalines
;
Jan-Mar12 0.10	0.22
Apr-Jun12 0.10	0.21
Jul-Sep12 0.15	0.42
Oct-Dec12 0.10	0.34
Jan-Mar13 0.05	0.29
Apr-Jun13 0.07	0.17
Jul-Sep13 0.10	0.36
Oct-Dec13 0.12	0.31
Jan-Mar14 0.09	0.22
Apr-Jun14 0.12	0.23
Jul-Sep14 0.11	0.24
Oct-Dec14 0.15	0.34
Jan-Mar15 0.10	0.21
Apr-Jun15 0.12	0.18
Jul-Sep15 0.10	0.33
Oct-Dec15 0.10	0.33
Jan-Mar16 0.08	0.16
Apr-Jun16 0.10	0.18
Jul-Sep16 0.11	0.28
Oct-Dec16 0.14	0.30
;
run;
* doing plots of the data by quarter;
PROC SGPLOT DATA = control2;

 SERIES X = Quarter Y = Comparator;
 series x=Quarter y=Intervention;
 TITLE 'Quarterly time-series of perentage of asthma visits in under 2 and 2-16 year olds, Bradford';
RUN; 

 

PeterClemmensen
Tourmaline | Level 20

Like this?

 

data control2;
input Quarter  $ 1-9  Comparator  Intervention;
datalines
;
Jan-Mar12 0.10 0.22
Apr-Jun12 0.10 0.21
Jul-Sep12 0.15 0.42
Oct-Dec12 0.10 0.34
Jan-Mar13 0.05 0.29
Apr-Jun13 0.07 0.17
Jul-Sep13 0.10 0.36
Oct-Dec13 0.12 0.31
Jan-Mar14 0.09 0.22
Apr-Jun14 0.12 0.23
Jul-Sep14 0.11 0.24
Oct-Dec14 0.15 0.34
Jan-Mar15 0.10 0.21
Apr-Jun15 0.12 0.18
Jul-Sep15 0.10 0.33
Oct-Dec15 0.10 0.33
Jan-Mar16 0.08 0.16
Apr-Jun16 0.10 0.18
Jul-Sep16 0.11 0.28
Oct-Dec16 0.14 0.30
;
run;
* doing plots of the data by quarter;
PROC SGPLOT DATA = control2;

 SERIES X = Quarter Y = Comparator;
 series x=Quarter y=Intervention;
 TITLE 'Quarterly time-series of perentage of asthma visits in under 2 and 2-16 year olds, Bradford';

 yaxis label='Percentage';
RUN; 
sks521
Quartz | Level 8

Ta.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 639 views
  • 0 likes
  • 2 in conversation