Is it possible to rotate a plot in R (base graphics)?

后端 未结 6 1819
灰色年华
灰色年华 2020-11-30 12:45

I searched for this and found that with {grid} there are ways to rotate an image, and that for some plots you can play with their rotation (for example plot(x,y) instead of

6条回答
  •  攒了一身酷
    2020-11-30 12:58

    A function rotate_plot to be used like

    rotate_plot(some_base_plot(x, y, ...))
    

    isn't possible because most of the base plot don't return a value.

    Some of the plots contain a horiz argument to allow you to choose which way round you want the plot drawing. Take a look at barplot.default to see how to implement this. (Warning: it's messy.)

    @ucfagls's suggestion to use gridBase is your best bet. There are some examples of its use in Appendix B of Murrell's R Graphics.

提交回复
热议问题