Desktop productivity for business analysts and programmers

plot dates Not in time-series

Posts: 0

plot dates Not in time-series

I previously posted this question on the Procedures forum, but I think maybe it actually belongs here since this is being done in EG.

Is it possible in PROC GPLOT to plot dates along the x-axis as categorical variables instead of time-series?

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.

If I use the bar-line chart and specify to use "one bar for each unique data value" it will plot like mentioned above, but I need to be able to plot multiple lines like this. I've got to believe this is possible in SAS, maybe here I would need to convert the dates to text???

Thanks for any help,
Trusted Advisor
Posts: 2,114

Re: plot dates Not in time-series

To convert a date data type to a character variable that has 'sortable' characteristics, use one of the year-month-day types, like

PUT(MyDateVar, yymmdd10.)

in the expression builder to create a text version on the original date.

Presenting a naturally scaled variable as ordinal may distort the relationship in the variables. Caveat emptor.
Posts: 0

Re: plot dates Not in time-series

That works for what I'm trying to do. Thanks.
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation