BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
djbateman
Lapis Lazuli | Level 10

Is there a way to display axis tick marks using one measurement but display labels based on a different measurement?

I have been asked to plot a Kaplan-Meier curve with the x-axis showing tick marks as weeks but labeling in months.  This is not as simple as assuming that a month has exactly 4 weeks.  I am using the formula: MONTHS=(WEEKS*7)/30.4375.  Thus, 8 weeks will not appear as 2 months but rather 1.84 months.  In other words, my labels will be slightly off of my tick marks as I attempt to display below:

|     |     |     |     |     |     |     |     |     |     |     |     |     |     ...

0                       1                       2                      13    ...

1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

Here's one trick you could use with gplot ...

You could annotate the monthly labels.

Here's a similar example where the x-axis is by month, and I annotate the year:

Worldwide Browser Popularity

http://robslink.com/SAS/democd59/browser_wars_info.htm

If you want, you can totally suppress the individual tickmark values by using 'value=none' on the axis statement.

View solution in original post

1 REPLY 1
GraphGuy
Meteorite | Level 14

Here's one trick you could use with gplot ...

You could annotate the monthly labels.

Here's a similar example where the x-axis is by month, and I annotate the year:

Worldwide Browser Popularity

http://robslink.com/SAS/democd59/browser_wars_info.htm

If you want, you can totally suppress the individual tickmark values by using 'value=none' on the axis statement.

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
  • 1 reply
  • 681 views
  • 0 likes
  • 2 in conversation