开发者

remove top and right border from ggplot2 [duplicate]

This question already has answers here: Remove grid, background color, and top and right borders from ggplot2 (8 answers) Closed 9 years ago.

Is it possible to to remove t开发者_JAVA百科he 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


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.


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())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜