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

Hello. I have a dataset which I'm plotting; however, I can't get my graph to label the x-axis so that both the beginning and ending data points are labeled on the x-axis. I'm using the following code. I've tried all kinds of different approaches but can't get the 3Q13 label to show on my x-axis. The chart is correctly plotting from 01Q1 to 13Q3, but the x-axis will only show 13Q1 as the last labeled item, which can be misleading to the viewer. Any suggestions? I've tinkered with the MAX option for the XAXIS statement, but without any luck.

Thanks in advance.

PROC SGPLOT DATA = work.temp

                     (where = (hcname = "&hcname." and SASDATE GE '31MAR2001'D))

                     NOAUTOLEGEND ;

              FORMAT SASDATE YYQ4.;

              SERIES X = SASDATE  Y = &VARIABLE. /  TRANSPARENCY=1;

                     BAND Y= &VARIABLE. UPPER = '31DEC2007'D LOWER = '30JUN2009'D;

                     BAND Y= &VARIABLE. UPPER = '31MAR2001'D LOWER = '30NOV2001'D;

              SERIES X = SASDATE  Y = &VARIABLE. / MARKERS CURVELABEL = "&CURVELABEL."

                           CURVELABELLOC = OUTSIDE DATALABEL =&VARIABLE. LINEATTRS=(Color=Red) CURVELABELATTRS=(Color=Red);

            

                     XAXIS TYPE=TIME   LABEL = " " FITPOLICY= THIN TICKVALUEFORMAT = YYQ4. VALUES=('31MAR2001'D TO '30SEP2013'D BY QUARTER );

                     YAXIS /* MIN = 0 MAX = 5 */ TYPE = LINEAR LABEL = "&YAXISLABEL.";

         

              RUN;

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

In the doc it says that the VALUES=() option works differently if you specify the values explicitly instead of via a range description  (a TO b BY c). So, try stating explicitly the full list of tick mark values that you want. Also remove the FITPOLICY=THIN option because that gives SAS the permission to remove some of the tick mark values.

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

In the doc it says that the VALUES=() option works differently if you specify the values explicitly instead of via a range description  (a TO b BY c). So, try stating explicitly the full list of tick mark values that you want. Also remove the FITPOLICY=THIN option because that gives SAS the permission to remove some of the tick mark values.

PG

PG
emikea
Calcite | Level 5

Thank you. Explicitly naming the tick mark values did the trick.

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