BookmarkSubscribeRSS Feed
keen_sas
Quartz | Level 8
Hi All,

I hvae used split option in axis statement to split the values into two lines on x-axis .Since i have used the tick option the split option is not working here, i have even tried with the format statement also to split it into two lines
Because of the irregular weeks, i have to use tick option to display them rather than by using them directly.
axis2 order=(0 to 52 by 4) offset=(4,4) label=none minor=none split =','
value=(h=3 tick=1 '0,V4' tick=2 '4,V5' tick=3 '8,V7' tick=4 '12,V8' tick=5 ' ' tick=6 ' ' tick=7 ' ' tick=8 '26,V9' tick=9 ' '
tick=10 ' ' tick=11 '39,V10' tick=12 ' ' tick=13 ' ' tick=14 '52,,V11' );


I need to display the x-axis label in two lines like this

0 2 4 9 12 14 (This is firstline for weeks)
v1 v2 v3 v4 v5 v6 (this is second line for visits)

Can anyone please help me in splitting the value into two lines inspite of tick option, or any other alternative.

Thanks in advance for your suggestions.
2 REPLIES 2
keen_sas
Quartz | Level 8
> Hi All,
>
> I hvae used split option in axis statement to split
> the values into two lines on x-axis .Since i have
> used the tick option the split option is not working
> here, i have even tried with the format statement
> also to split it into two lines
> ecause of the irregular weeks, i have to use tick
> option to display them rather than by using them
> directly.
> axis2 order=(0 to 52 by 4) offset=(4,4) label=none
> minor=none split =','
> value=(h=3 tick=1 '0,V4' tick=2 '4,V5' tick=3
> '8,V7' tick=4 '12,V8' tick=5 ' ' tick=6 ' ' tick=7 '
> ' tick=8 '26,V9' tick=9 ' '
> tick=10 ' ' tick=11 '39,V10' tick=12 ' '
> tick=13 ' ' tick=14 '52,,V11' );
>
>
> I need to display the x-axis label in two lines like
> this
>
> 0 2 4 9 12 14 (This is firstline
> for weeks)
> v1 v2 v3 v4 v5 v6 (this is second line
> for visits)
>
> Can anyone please help me in splitting the value
> into two lines inspite of tick option, or any other
> alternative.
>
> Thanks in advance for your suggestions.

This has to be done using proc gplot.

Thanks
ArtC
Rhodochrosite | Level 12
I have never been very successful with the split= option. However repeating a justification option will cause the text to split.
[pre]
axis1 value = (t=1 j=c '11' j=c 'years'
t=2 j=c '12' j=c 'years');
proc gplot data=sashelp.class;
plot weight* age/haxis=axis1;
run;
quit;
[/pre]

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1575 views
  • 0 likes
  • 2 in conversation