Re: text box with background colour

17 views
Skip to first unread message

adam.l...@pnc.com

unread,
May 16, 2013, 2:29:47 PM5/16/13
to Ravi, ggp...@googlegroups.com
Here's one way

p1<-ggplot(data=d1,aes(x=x,y=y))+
geom_point()+geom_line()+
geom_rect(colour="black",fill="white",aes(xmin=1,xmax=4.1,ymin=43,ymax=55))

p1+annotate(x=2.5,y=50,geom="text",label=l1)





Adam Loveland




From: Ravi <rv1...@gmail.com>
To: ggp...@googlegroups.com
Date: 05/16/2013 01:42 PM
Subject: text box with background colour
Sent by: ggp...@googlegroups.com





This is my first posting to this group.
I am interested in having a text box in my plot with black text, white background colour and a border with thin lines.
My example :
x=1:10;y=x^2
d1<-data.frame(x=x,y=y)
l1<-"Some text"
p1<-ggplot(data=d1,aes(x=x,y=y))+geom_point()+geom_line()+geom_text(data=NULL,x=2,y=75,label=l1)
How do I access the options for changing the attributes for the text. For the legend, I have noted that there is an option for changing the legend.background colour. Are there any corresponding options for the text?

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example:
https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options:
http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.


The contents of this email are the property of PNC. If it was not addressed to you, you have no legal right to read it. If you think you received it in error, please notify the sender. Do not forward or copy without permission of the sender. This message may contain an advertisement of a product or service and thus may constitute a commercial electronic mail message under US Law. The postal address for PNC is 249 Fifth Avenue, Pittsburgh, PA 15222. If you do not wish to receive any additional advertising or promotional messages from PNC at this e-mail address, click here to unsubscribe. https://pnc.p.delivery.net/m/u/pnc/uni/p.asp
By unsubscribing to this message, you will be unsubscribed from all advertising or promotional messages from PNC. Removing your e-mail address from this mailing list will not affect your subscription to alerts, e-newsletters or account servicing e-mails.


Reply all
Reply to author
Forward
0 new messages