Vimal
unread,Aug 24, 2009, 5:53:02 AM8/24/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
Hi,
I am a new user to ggplot2 and I was wondering if any of you know how
to insert the last data point of the dataset as reference on the right
hand top corner of the graph.
Suppose I have a dataset with the last data point as on 1 July 2009
taking the value 48.3927. I want to insert this as "1 July 2009,
48.3927" on the right hand top corner of the graph so that readers
have a reference point for the graph.
library(tseries)
library(ggplot2)
B<-get.hist.quote("USD/
INR",provider="oanda",start="2009-01-01",end="2009-07-01")
C<-data.frame(dates=seq(as.Date("2009-01-01"),by=1,length.out=182),B)
print(ggplot(C,aes(x=dates))+geom_line(aes(y=B,colour="USD/
INR"),size=1.2)+scale_colour_manual("",c("USD/INR"="dark blue"))+opts
(legend.position=c(.3,.8),title="Exchange Rate")+labs(x=NULL,y=NULL))
Thanks!
Regards,
Vimal