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

In order to get uneven time space as following

yw2757_1-1587564196766.png

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= (  ) 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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."

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

yw2757
Fluorite | Level 6

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. 

 

yw2757_0-1587566625675.png

 

Rick_SAS
SAS Super FREQ

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."

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 1325 views
  • 0 likes
  • 3 in conversation