BookmarkSubscribeRSS Feed
somebody
Lapis Lazuli | Level 10

My PROC SGPLOT  produces a weird gap on the right. I tried to set MAX value but it does not work.My year quarter has YYQn6. format and the maximum value in my data is 20164( quarter 4 2016). I tried MAX option  but it does not work

Here is my code:

proc sgplot data= input;
	series x=yearquarter y=series1/lineattrs=(color=red pattern = solid) legendlabel= "Small firms";
	series x=yearquarter y=series2/lineattrs=(color=blue pattern = thindot) legendlabel= "Medium firms";
	series x=yearquarter y=series3/lineattrs=(color=black pattern = longdash) legendlabel= "Big firms";
	series x=yearquarter y=liq_mean/lineattrs=(color=green pattern=dash thickness= 3) legendlabel= "All firms";
	YAXIS LABEL = "metric";
	XAXIS LABEL = 'Year' MAX='20DEC2014'D;
run;

Here is what the graph looks like. the max value on the x-axis is 2020 but in the data, it is 2016

 

Capture.PNG

2 REPLIES 2
Reeza
Super User

Have you tried specifying a time interval? Specifically Quarter. 

 

If SAS overrides the max value it usually leaves a note in the log, was there any messages in your log?

 

Note: I'm moving this post to the graphics forum for better responses.

somebody
Lapis Lazuli | Level 10

yes there is a note:

NOTE: The column format YYQN6 is replaced by an auto-generated format on the axis.

so I specified it to be quarter and that problem solved but they displayed all quarter labels on the xaxis which makes it look ugly.

Capture.PNG

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