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
Super User

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
Super User

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
Super User

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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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