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 !

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