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

Can someone please help me with the ranges option in the following code?  It is not yielding the expected result of limiting the yaxis data to the range of 60 to 100%.  

 

Thanks,

 

Gene

data data;
input LOHI $ k3_6 Group $;
datalines;
36/0 90.18 RoOPT
39/0 93.31 RoOPT
39/41 94.55 RoOPT
39/43 95.21 RoOPT
39/45 95.79 RoOPT
39/47 95.58 RoOPT
39/49 95.60 RoOPT
39/51 94.85 RoOPT
39/53 95.12 RoOPT
39/55 95.43 RoOPT
39/59 96.02 RoOPT
39/61 96.29 RoOPT
39/63 96.52 RoOPT
39/65 96.88 RoOPT
39/67 96.78 RoOPT
39/69 96.84 RoOPT
39/71 96.85 RoOPT
36/0 66.59 RoCOV
39/0 72.53 RoCOV
39/41 72.87 RoCOV
39/43 73.22 RoCOV
39/45 73.52 RoCOV
39/47 71.02 RoCOV
39/49 69.95 RoCOV
39/51 70.65 RoCOV
39/53 70.79 RoCOV
39/55 70.95 RoCOV
39/59 71.25 RoCOV
39/61 71.39 RoCOV
39/63 71.51 RoCOV
39/65 71.59 RoCOV
39/67 71.64 RoCOV
39/69 71.67 RoCOV
39/71 71.68 RoCOV
;
ods graphics / reset width=6.4in height=4.8in imagemap;

proc sgplot data=WORK.DATA;
title "Sensitivity of Optimization Results to Elevation Angle";
title2 "Region of Optimization (RoOPT): 440km by 440km";
title3 'Region of Coverage (RoCOV): All Gridpoints where k GE 1';

	vbar LOHI / response=k3_6 group=group groupdisplay=cluster;
	yaxis grid ranges=(60-100);
	xaxis label="LO/HI Elevation Angles";
	yaxis label="Gridpoints Covered by 3-6 Stations (%)";
run;

ods graphics / reset;
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You have two YAXIS statements. The latter one overwrites your earlier one so include only one, with both the LABEL and RANGES included in the same statement.

 


@genemroz wrote:

Can someone please help me with the ranges option in the following code?  It is not yielding the expected result of limiting the yaxis data to the range of 60 to 100%.  

 

Thanks,

 

Gene

data data;
input LOHI $ k3_6 Group $;
datalines;
36/0 90.18 RoOPT
39/0 93.31 RoOPT
39/41 94.55 RoOPT
39/43 95.21 RoOPT
39/45 95.79 RoOPT
39/47 95.58 RoOPT
39/49 95.60 RoOPT
39/51 94.85 RoOPT
39/53 95.12 RoOPT
39/55 95.43 RoOPT
39/59 96.02 RoOPT
39/61 96.29 RoOPT
39/63 96.52 RoOPT
39/65 96.88 RoOPT
39/67 96.78 RoOPT
39/69 96.84 RoOPT
39/71 96.85 RoOPT
36/0 66.59 RoCOV
39/0 72.53 RoCOV
39/41 72.87 RoCOV
39/43 73.22 RoCOV
39/45 73.52 RoCOV
39/47 71.02 RoCOV
39/49 69.95 RoCOV
39/51 70.65 RoCOV
39/53 70.79 RoCOV
39/55 70.95 RoCOV
39/59 71.25 RoCOV
39/61 71.39 RoCOV
39/63 71.51 RoCOV
39/65 71.59 RoCOV
39/67 71.64 RoCOV
39/69 71.67 RoCOV
39/71 71.68 RoCOV
;
ods graphics / reset width=6.4in height=4.8in imagemap;

proc sgplot data=WORK.DATA;
title "Sensitivity of Optimization Results to Elevation Angle";
title2 "Region of Optimization (RoOPT): 440km by 440km";
title3 'Region of Coverage (RoCOV): All Gridpoints where k GE 1';

	vbar LOHI / response=k3_6 group=group groupdisplay=cluster;
	yaxis grid ranges=(60-100);
	xaxis label="LO/HI Elevation Angles";
	yaxis label="Gridpoints Covered by 3-6 Stations (%)";
run;

ods graphics / reset;

 

View solution in original post

3 REPLIES 3
Reeza
Super User

You have two YAXIS statements. The latter one overwrites your earlier one so include only one, with both the LABEL and RANGES included in the same statement.

 


@genemroz wrote:

Can someone please help me with the ranges option in the following code?  It is not yielding the expected result of limiting the yaxis data to the range of 60 to 100%.  

 

Thanks,

 

Gene

data data;
input LOHI $ k3_6 Group $;
datalines;
36/0 90.18 RoOPT
39/0 93.31 RoOPT
39/41 94.55 RoOPT
39/43 95.21 RoOPT
39/45 95.79 RoOPT
39/47 95.58 RoOPT
39/49 95.60 RoOPT
39/51 94.85 RoOPT
39/53 95.12 RoOPT
39/55 95.43 RoOPT
39/59 96.02 RoOPT
39/61 96.29 RoOPT
39/63 96.52 RoOPT
39/65 96.88 RoOPT
39/67 96.78 RoOPT
39/69 96.84 RoOPT
39/71 96.85 RoOPT
36/0 66.59 RoCOV
39/0 72.53 RoCOV
39/41 72.87 RoCOV
39/43 73.22 RoCOV
39/45 73.52 RoCOV
39/47 71.02 RoCOV
39/49 69.95 RoCOV
39/51 70.65 RoCOV
39/53 70.79 RoCOV
39/55 70.95 RoCOV
39/59 71.25 RoCOV
39/61 71.39 RoCOV
39/63 71.51 RoCOV
39/65 71.59 RoCOV
39/67 71.64 RoCOV
39/69 71.67 RoCOV
39/71 71.68 RoCOV
;
ods graphics / reset width=6.4in height=4.8in imagemap;

proc sgplot data=WORK.DATA;
title "Sensitivity of Optimization Results to Elevation Angle";
title2 "Region of Optimization (RoOPT): 440km by 440km";
title3 'Region of Coverage (RoCOV): All Gridpoints where k GE 1';

	vbar LOHI / response=k3_6 group=group groupdisplay=cluster;
	yaxis grid ranges=(60-100);
	xaxis label="LO/HI Elevation Angles";
	yaxis label="Gridpoints Covered by 3-6 Stations (%)";
run;

ods graphics / reset;

 

genemroz
Quartz | Level 8

Thank you for the prompt response.  I knew I was doing something stupid (sigh).

 

Gene

Rick_SAS
SAS Super FREQ

Use only one YAXIS statement. 

yaxis grid ranges=(60-100) label="Gridpoints Covered by 3-6 Stations (%)";

 

You could also use the MIN= and MAX= options:

yaxis grid min=60 max=100 label="Gridpoints Covered by 3-6 Stations (%)";

 

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 864 views
  • 2 likes
  • 3 in conversation