Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
376 views
in Technique[技术] by (71.8m points)

r - List of ggplot2 theme options?

After some research I found the way to prevent an uninformative legend from displaying

... + theme(legend.position = "none")

Where can I find all of the available theme options and their default values for ggplot2?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The closest thing to a comprehensive list that I have been able to find is in the ggplot2 wiki on github. I think that most of the options are covered there with examples.

Update If you would like to see the options that are in use on a current plot, you can use plot_theme(x) to see all of the options that are currently set for the plot named x. It will not be a comprehensive list, but should help if you want to change something like the font size for an axis label.

Update 2 With the transition to version 0.9.0 it's worth noting that the built in documentation has been dramatically improved, and the transition guide from 0.8.9 to 0.9.0 is also worth checking out.

Update 3 There is now a ggplot2 documentation website. Look at the documentation for theme for a complete list. Also, ?theme has a pretty complete list as of 0.9.3.

Update 4 There is now a ggthemes package that has some nice themes and scales to choose from. It might save you from having to create your own. See their github page for more information.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...