用面和X轴标签的旋转 我使用ggplotly将我的情节互动在一个闪亮的应用程序中。我需要将X轴标签旋转45度。这可以正常工作,但是只有直到我有方面。如果我的情节有刻面,那么只有...

问题描述 投票:0回答:1

                
您可以在GGPLOT2中用
theme()

来照顾它,或者设置为-45°
xaxis2
r ggplot2 plotly ggplotly
1个回答
0
投票

library(dplyr) library(ggplot2) library(plotly) df <- expand.grid(x = 1:10, group = c("a", "b"))

p <- ggplot(df) +
  geom_point(aes(x = x, y = x))

p <- p + facet_wrap(~ group)
ggplotly(p) %>% layout(xaxis = list(tickangle = -45),
                       xaxis2 = list(tickangle = -45))
    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.