Is it possible to to remove the top and right border from ggplot2 graphs?
I.e, I'd like to keep the x and y-axis but remove the rest of the black frame that surrounds the graph.
//M
You can add this to your plot
+ opts(panel.grid.minor = theme_blank())
+ opts(panel.grid.major = theme_blank())
+ opts(axis.line = theme_segment())
Since version 0.9.2, opts
has been replaced by theme
:
+ theme(panel.grid.minor = element_blank())
+ theme(panel.grid.major = element_blank())
+ theme(axis.line = element_segment())
see this thread, it deals specifically with the problem here
http://groups.google.com/group/ggplot2/browse_thread/thread/f998d113638bf251
and gives a solution that appears to work.