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

 

Hi,

   I have created the following plot . this has the axex on log-scale but displayed the linear numbers as tick values. I would like to keep the same display, but to display the axes values as 1,2,3,4,5,10,20 and remove anything in between displayed. how do I do this?

 

My code below:


proc sgplot data=&G_DDDATASETNAME dattrmap=myattr;
scatter y=max_alt x=bas_alt / group=trt01a attrid=trt01a;
refline &refx /axis=x;
refline &refy /axis=y;
keylegend /title="" noborder;
xaxis &xval label= 'Baseline ALT (/ULN)' type=log logbase=10 logstyle=linear max=20;
yaxis &yval label= 'Maximum On-treatment ALT (/ULN)' type=log logbase=10 logstyle=linear max=20;
run;

 

The x axis in the plot below has displyed the axis tick values 0.3, 2,4 6,8,10,12,16,20. I would need to remove 0.3,6,8,12,16 and include 1,2,3,4,5,10,20.

 

Manj_1-1603487610119.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Ha! Add option VALUESHINT to the axis statements to get the full range of the data while keeping the ticks specified in the VALUES option. When you specify VALUESHINT, you can also specify MIN= and MAX= values to create extra white space around your data.

PG

View solution in original post

4 REPLIES 4
PGStats
Opal | Level 21

Try option VALUES=(1 2 3 4 5 10 20) in your xaxis and yaxis statements.

PG
Manj
Fluorite | Level 6
Values=(1 2 3 4 5 20 20) keeps the display different. It starts only from 1 and the tick marks will be equidistant. Plz note I’m doing on a log scale but linear axis tick label.
PGStats
Opal | Level 21

Ha! Add option VALUESHINT to the axis statements to get the full range of the data while keeping the ticks specified in the VALUES option. When you specify VALUESHINT, you can also specify MIN= and MAX= values to create extra white space around your data.

PG
Manj
Fluorite | Level 6

Thanks, It worked !

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1505 views
  • 1 like
  • 2 in conversation