BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is it possible in PROC GPLOT to plot dates along the x-axis as categorical variables instead of time-series? By doing this I would want dates that are 1 week, 1 month, or 1 year apart from each other to be plotted next to each other with the same amount of spacing between them.

I am doing this in SAS Enterprise Guide 4.1.

Thanks,
Brad
5 REPLIES 5
Peter_C
Rhodochrosite | Level 12
I recall defining axis or midpoints with [pre] "01jan2006"d to "01jan2008"d by month [/pre] which produces an unimportant message that the intervals are not equal.

Would something like that help ?

PeterC
deleted_user
Not applicable
Thanks for the reply Peter,
I tried this and all I get is the same output as before, only now it only goes from Jan '06 to Jan '08.

My problem is that if I have 10 datapoints total that are being plotted and 6 points are in january '06 and my next 4 datapoints are in November '08 I'm getting a long straight line from the last datapoint in January until my first data point in November. I would like for this to plot the 10 points equidistant from each other instead of putting the time gap in between them (not sure if this is possible).
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Another option is to code your axis datapoints explicitly, noting that you can code them as a date literal, as well as stated previously with a date-range. Obviously, choosing the values to plot on the axis will be based on your own data and some calculated decision for your axis requirements.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Is there a way to code this dynamically so the dates to plot would change each time the process is run? I wont really know the exact dates that are going to need to be plotted, and there could be hundreds of them.
Thanks
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Not really and it depends. The "dynamic" part would need to be your own thought / code process based on the input data to be charted, as you have conveyed. And you would need to generate explicit (or range-of) values to plot on a given axis. Most likely that would be DATA step code and SAS statements to generate SAS code dynamically which you would then invoke.

Scott Barry
SBBWorks, Inc.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 712 views
  • 0 likes
  • 3 in conversation