Hi Mark,
A few things:
1) Unless you have an old version of ggplot2 you should be using theme
instead of opt and element_* instead of theme_*
2) The rectangle is being drawn, but is covered by the plot itself
since you've set expand = (0,0) and panel.background is drawn under
the plot
3) The list of theme elements is documented in ?theme, which should
lead to you panel.border
4) You will still need to to coordinate the size of the border with
the x and y axis scale expansion--it can be helpful to use a
transparent border at first to get the size right
For example:
p + theme(panel.border=element_rect(fill = NA, colour=alpha('black',
.5),size=10))
## border covers substantial part of the plot, so:
p + scale_x_discrete(expand = c(.02, 0)) +
scale_y_discrete(expand = c(.02, 0)) +
theme(panel.border=element_rect(fill = NA, colour=alpha('black', .5),size=10))
Best,
Ista
> --
> --
> 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.