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

Tickvalueformat prints y axis labels up to 6 y values. More than 6, it skips every other label!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Try

yaxis display= (nolabel noline noticks) values=(1 to 11 by 1) tickvalueformat = yfmt. ;

 

 

View solution in original post

4 REPLIES 4
ballardw
Super User

1) It never hurts to show the code. Paste code into a code box opened on the forum with the </> or "running man" icon.

2) data in form of a data step

3) if using a custom format then the format code is likely needed

 

The axis statements have an option called FITPOLICY that determines how certain clashes between tick mark spacing and length of formatted values are treated. Which defaults to THIN (show fewer values). So that may be something to investigate.

jgaughan
Calcite | Level 5

data test;
input
y y_label$ x_label x low high x_label2$
;
datalines;

1 risk_pe 0 0 0.9 1 .
1 risk_pe .05 12 0.9 1 .
1 risk_pe .1 24 0.9 1 .
1 risk_pe .15 36 0.9 1 .
1 risk_pe .2 48 0.9 1 .
1 risk_pe .25 60 0.9 1 .
1 risk_pe .3 72 0.9 1 .
1 risk_pe .35 84 0.9 1 .
1 risk_pe .4 96 0.9 1 .
1 risk_pe .45 108 0.9 1 .
1 risk_pe .5 120 0.9 1 .
1 risk_pe .55 132 0.9 1 .
1 risk_pe .6 144 0.9 1 .
1 risk_pe .65 156 0.9 1 .
1 risk_pe .7 168 0.9 1 percent

 

2 total_pts 0 0 1.9 2 low
2 total_pts 10 10 1.9 2 .
2 total_pts 20 20 1.9 2 .
2 total_pts 30 30 1.9 2 .
2 total_pts 40 40 1.9 2 .
2 total_pts 50 50 1.9 2 .
2 total_pts 60 60 1.9 2 .
2 total_pts 70 70 1.9 2 .
2 total_pts 80 80 1.9 2 .
2 total_pts 90 90 1.9 2 .
2 total_pts 100 100 1.9 2 .
2 total_pts 110 110 1.9 2 .
2 total_pts 120 120 1.9 2 .
2 total_pts 130 130 1.9 2 .
2 total_pts 140 140 1.9 2 .
2 total_pts 150 150 1.9 2 .
2 total_pts 160 160 1.9 2 .
2 total_pts 170 170 1.9 2 .

3 age 10 0 2.9 3 yrs
3 age 90 10 2.9 3 .

4 chron_lung 0 0 3.9 4 .
4 chron_lung 1 8 3.9 4 .

5 chf 0 0 4.9 5 .
5 chf 1 12 4.9 5 .

6 dm 0 0 5.9 6 .
6 dm 1 5 5.9 6 .

7 htn 0 0 6.9 7 .
7 htn 1 5 6.9 7 .

8 pulm_circ 0 0 7.9 8 .
8 pulm_circ 1 100 7.9 8 .

9 valve 0 0 8.9 9 .
9 valve 1 17 8.9 9 .

10 elytes 0 0 9.9 10 .
10 elytes 1 6 9.9 10 .

11 points 0 0 10.9 11 .
11 points 10 10 10.9 11 .
11 points 20 20 10.9 11 .
11 points 30 30 10.9 11 .
11 points 40 40 10.9 11 .
11 points 50 50 10.9 11 .
11 points 60 60 10.9 11 .
11 points 70 70 10.9 11 .
11 points 80 80 10.9 11 .
11 points 90 90 10.9 11 .
11 points 100 100 10.9 11 .

;
proc format;
value yfmt
11='points'
10='elytes'
9='valve'
8='pulm_circ'
7='htn'
6='dm'
5='chf'
4='chron_lung'
3='age'
2='Total Points'
1='Risk of PE';
run;

ods listing gpath="c:\temp";
proc sgplot data = test noautolegend ;
series x = x y = y/ group = y_label
lineattrs = (pattern = 1 thickness = 2);
highlow x=x high = high low=low / lowlabel=x_label
highlabel=x_label2;
yaxis display= (nolabel noline noticks) tickvalueformat = yfmt. ;
xaxis display= none ;
run;

ballardw
Super User

Try

yaxis display= (nolabel noline noticks) values=(1 to 11 by 1) tickvalueformat = yfmt. ;

 

 

jgaughan
Calcite | Level 5
Thank you so much

JG

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1185 views
  • 0 likes
  • 2 in conversation