BookmarkSubscribeRSS Feed
Tiny_Kane
Obsidian | Level 7

Hi there, I want to display uneven value in the axis using proc sgplot, but it looks like the VALUE statement does not work. My code is attached below. But the output plot only shows 0, 12, 36, and 60 in the axis. 

 

proc sgplot data=cif1;
step x=months_to_scenario1 y=cif/group=study_id name="curve";
scatter x=months_to_scenario1 y=cenp / markerattrs=(symbol=plus) GROUP=study_id ;
text x=t1 y=s1 text=texc1/position=center textattrs=(size=10) outline;
xaxis offsetmin=0.015 offsetmax=0.015 max=60 values=(0 1 12 24 36 48 60);
yaxis max=0.25;
keylegend "curve";
run;

 

Thank you. 

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

I can't see your data, so needless to say, this is untested. I think you just need to use the VALUESHINT Option in the xaxis Statement. 

ballardw
Super User

The tick at 1 likely does not appear as there is not enough space on the graph and that likely causes a note like this:

 

NOTE: Some of the tick values have been thinned.

And once the "thinning" process starts other values get removed.

Example that places irregular intervals:

proc sgplot data=sashelp.class;
scatter x=height y=weight / markerattrs=(symbol=plus) GROUP=sex ;
xaxis offsetmin=0.015 offsetmax=0.015 max=70 values=(40  47 53 62 70);
run;

But if I add 41 to the values then not only does the 41 not appear but 47, 53 and 70 do not appear on the axis.

 

proc sgplot data=sashelp.class;
scatter x=height y=weight / markerattrs=(symbol=plus) GROUP=sex ;
xaxis offsetmin=0.015 offsetmax=0.015 max=70 values=(40 41 47 53 62 70);
run;

With a range of 0 to 60 I am not quite sure what a tick mark at 1 tells you. If that is hypercritical then perhaps dropping 1 from the VALUES and adding a REFLINE at value 1 with  an interesting label might be a good idea.

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
  • 2 replies
  • 2220 views
  • 2 likes
  • 3 in conversation