List of ggplot2 theme options?

后端 未结 9 1719
清歌不尽
清歌不尽 2020-11-30 18:08

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

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

Where can I

相关标签:
9条回答
  • 2020-11-30 19:05

    All the options I've ever used have been explained in hadley's great ggplot2 book.

    0 讨论(0)
  • 2020-11-30 19:08

    Besides the obvious references to ggplot2 reference manual and to the graphs section of Cookbook for R, Hadley Wickham provides a nice opts() List on github.

    0 讨论(0)
  • 2020-11-30 19:10

    The ggplot2 package does not contain much reference information-- this is probably because Hadley has put a lot of work into developing and polishing the package, creating a website full of examples and writing an excellent book that describes the system in detail.

    The first place I would look for answers would be the ggplot2 website:

    http://docs.ggplot2.org/

    However, since opts() is not really a geom, stat or scale there are no examples that focus specifically on it. The next place to look would be the section of the website that contains material from the book-- including source code for examples:

    http://ggplot2.org/book/

    The example code for the chapter "Polishing your plots for publication" contains some well commented examples of using set_theme() and opts() to alter plot appearance.

    The ultimate source for information is of course the book it's self. If you find ggplot2 has simplified and streamlined your workflow for producing statistical graphics, buying a copy of the book is a great way to say "thank you" and support the further development of the package.

    Update

    After some further investigation, you may be able to find a relatively complete list of options by listing out the source of one of the "theme" functions such as theme_bw. The source doesn't provide a description of the possible key=value pairs, but it does at least show most of the key names that have an effect when set via opts().

    0 讨论(0)
提交回复
热议问题