In order to get uneven time space as following
I manually type
Xaxis Label= "Analysis Visits"
Type= discrete
Values= (12 to 28 by 1)
Valuesdisplay= ("Week 12" "Week 13" "" "" "Week 16" "" "" "" "Week 20" "" "" "" "Week 24" "" "" "" "Week 28 (Follow-up)");
However, I do find
proc sgplot data=age; scatter x=age y=weight; xaxis grid values=(6 9 13 16 19 21 25 30 40 50) valueshint; yaxis grid; run;
can provide uneven space automatically.
Any one can provide suggestions about how to get uneven space via PROC SGPLOT by using values= ( )
I think a FORMAT statement is probably easiest, but you can also use SYMPUTX in a DATA _NULL_ step to create a macro variable that contains the tick values and the strings to display.
See the last paragraph "Automating the tick locations and labels" in the article "Create custom tick marks for axes on the log scale."
I think you need to rephrase your question or requirement.
Your question "how to get uneven space via PROC SGPLOT by using values= ( ) " is answered in your code with the values statement.
I think you may be having more a question about displaying specific text but it isn't clear if that is the case.
Likely a custom format for the values you want to display the desired text with an Other= ' ' to display blanks.
Sorry for the confusion. Before I used
values=(12 13 16 20 24 28)
valuesdisplay= ("Week 12", "Week 13", "Week 20", "Week 24", "Week 28")
and SGPLOT offers following result, all space are even. For example, space between week 13 and week 16.
I think a FORMAT statement is probably easiest, but you can also use SYMPUTX in a DATA _NULL_ step to create a macro variable that contains the tick values and the strings to display.
See the last paragraph "Automating the tick locations and labels" in the article "Create custom tick marks for axes on the log scale."
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.
Ready to level-up your skills? Choose your own adventure.