Reputation: 139
I am trying to plot SAS line plot with X- axis as Hour ( 0 , 1, 2...24) and Y axis is Decline Rate.
I started my monitoring at Hour = 20 (8PM) . I need to plot the line plot starting with 20.
When it goes to 0 , the line joins o to 20 forming a straight line.
How can i handle this in SAS. I am using PROC GPLOT
Upvotes: 1
Views: 175
Reputation: 1985
This is a difficulty for SAS, but one that can be managed.
I have two solutions:
Solution 1)
Keep the hour as a column in the data, but also add a date/time field to denote that the time is always increasing.
Use the date/time field and Decline Rate within gplot, but format the date/time field to only show hours.
Solution 2)
Add a new column to denote the order
data temp;
set temp;
order = _n_;
run;
Then sort by the new variable.
proc sort data=temp; by order; run;
Finally, utilize the sorted option within gplot. See the attached link for further information: http://www.math.wpi.edu/saspdf/gref/c21.pdf
Upvotes: 1