BookmarkSubscribeRSS Feed
brophymj
Quartz | Level 8

I'm creating graphs using the proc sgplot data where there are many levels (30+) the text for the horixontal axis labels is squashed together as there are so many levels. Is there a way to get around this? Perhaps only show every 5th level (as most of the factors follow a logical order i.e. 1988-2014).

  options orientation=landscape nodate nonumber;

  ods listing gpath="path";
  ods pdf file="path\flag1.pdf" columns=2 style=meadow startpage=no;
  ods graphics on/width=4.5in height=3.75in;

   proc sgplot data=dataset ;

     title title";

     vline exposureyear / group = level response = exposure;

  run;

ods graphics off;

  ods pdf close;

Thanks 

2 REPLIES 2
PGStats
Opal | Level 21

Look at option FITPOLICY= on the XAXIS statement. The number of policies available increases with the SAS version. - PG

PG
ballardw
Super User

Or an XAXIS statement such as

Xaxis values = (1988 to 2018 by 5); (the end value should be an exact number of interval size to get expected results, you could use 1985 to 2015 by 5 as well which would be a tad more common if these are years)

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