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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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