adding an annotation with absolute position

146 views
Skip to first unread message

Upton, Stephen (Steve) (CIV)

unread,
Sep 28, 2011, 11:56:47 AM9/28/11
to ggplot2 (ggplot2@googlegroups.com)

Hi All,

 

I’d like to add an annotation based on the graph’s positioning, rather than the data. For example, I’d like to add an annotation in the lower half of the graph. I see I can use viewports, but wondered if there was a way to do this just with the annotation parameters.

 

ggplot2 is great! And I’m sure I haven’t grokked the graphics grammar just yet. L

 

thanx

steve

 

Stephen C. Upton

Research Associate
SEED (Simulation Experiments & Efficient Designs) Center
Operations Research Department
Naval Postgraduate School
Cell: 831-402-3888
NIPR: scu...@nps.edu
SEED Center web site: http://harvest.nps.edu

 

Adam_L...@keybank.com

unread,
Sep 28, 2011, 1:39:46 PM9/28/11
to Upton, Stephen (Steve) (CIV), ggplot2 (ggplot2@googlegroups.com)
Steve, does this help?

tst2<-data.frame(x=rnorm(1000),y=rnorm(1000))

ggplot(tst2,aes(x,y))+geom_point()+geom_text(aes(0,0),label="Dude, where's my car?",colour="red")



Adam Loveland
216-689-5409
1Key

This communication may contain privileged and/or confidential information. It is intended solely for the use of the addressee. If you are not the intended recipient, you are strictly prohibited from disclosing, copying, distributing or using any of this information. If you received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. This communication may contain nonpublic personal information about consumers subject to the restrictions of the Gramm-Leach-Bliley Act. You may not directly or indirectly reuse or redisclose such information for any purpose other than to provide the services for which you are receiving the information. 127 Public Square, Cleveland, OH 44114


If you prefer not to receive future e-mail offers for products or services from Key
send an e-mail to mailto:DNERe...@key.com with 'No Promotional E-mails' in the SUBJECT line.

Brandon Hurr

unread,
Sep 28, 2011, 1:48:18 PM9/28/11
to Adam_L...@keybank.com, Upton, Stephen (Steve) (CIV), ggplot2 (ggplot2@googlegroups.com)
If you want it in the bottom corner you can use Inf...

tst2<-data.frame(x=rnorm(1000),y=rnorm(1000)) 

ggplot(tst2,aes(x,y))+geom_point()+geom_text(aes(-Inf,-Inf),label="Dude, where's my car?",colour="red", vjust=0, hjust=0)

--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

Upton, Stephen (Steve) (CIV)

unread,
Sep 28, 2011, 2:33:39 PM9/28/11
to Brandon Hurr, Adam_L...@keybank.com, ggplot2 (ggplot2@googlegroups.com)

Thanks Brandon and Adam! Works like a charm.

 

steve

Reply all
Reply to author
Forward
0 new messages