I'd like to add text to an existing time series plot. The code I used to create the chart is as follows:
gplot(MI_FL_Data, aes(x=realdate, y=FLday)) + geom_area(fill="blue") + labs(x=NULL, y="Number of Daily COVID Cases", title="Florida ")
where x is the date and y is the number of cases each day. Now I'd like to add points where the governor declared actions (this variable is called FL_ClosingActions) and is text. I believe the correct way to do this is to add to the above code
+layer (geom_text)(aes(x=FL_ClosingActions, colour="red")
but I get an Error message: Attempted to create a layer with no stat. Does this mean I need to add (geom_point) somewhere in the code? I'm at a loss and this seems like it should be fairly simple. Any assistance is appreciated.
https://stackoverflow.com/questions/66836369/adding-geom-text-to-existing-chart March 28, 2021 at 05:37AM
没有评论:
发表评论