BookmarkSubscribeRSS Feed
GraphGuy
Meteorite | Level 14

If you can't find a way to do this with sgplot in your version of SAS (or without using annotate), here's how you could do it in a very straightforward manner with SAS/Graph gplot ...

 

proc format;
value xf
1="very long text long text X very long text long text"
2="long text long text, too X long text long text, too";
run;


data test;
x=1; y=2;
output;
x=2; y=3;
output;
run;


axis1 minor=none order=(2 to 3 by .2);


axis2 split='X' minor=none order=(1 to 2 by 1) offset=(10,10)
label=(justify=center "Will this very long, long, long text split somewhere after here"
           justify=center "and this further text be line 2?");


symbol1 value=circle height=1.5 interpol=join color=blue;


proc gplot data=test;
format x xf.;
plot y*x=1 /
vaxis=axis1 haxis=axis2;
run;

 

split.png

 

In one of the comments, you mentioned wanting to be able to use this with hh mm ss time formatted values(?) I have successfully used the SAS/Graph axis split=' ' option with the spaces in date values (formatted with nldateymm8.), so I think that should work in time values also. Here's the example with split date values:

 

 

lake_wheeler_enterococci_2014.png

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 15 replies
  • 7197 views
  • 2 likes
  • 5 in conversation