【发布时间】:2021-12-23 02:57:46
【问题描述】:
我想每 1 个月显示一次日期,但改为每 2 个月显示一次。我也想知道如何将日期(x 轴)倾斜 60 度。这两件事在情节上可能吗?提前致谢。
我的代码:
l <- list(
font = list(
family = "sans-serif",
size = 12,
color = "#364E6F"),
bgcolor = "#E4EBF5",
bordercolor = "#566F92",
borderwidth = 3)
fig <- plot_ly(sumir_data, x = sumir_data$`Month-year`, y = sumir_data$`Followers-LI`, type = 'bar', name = 'LinkedIn', marker = list(color = '#28EDC4'))
fig <- fig %>% add_trace(y = sumir_data$`EOM Followers Twitter-TW`, name = 'Twitter', marker = list(color = '#00BBFF'))
fig <- fig %>% layout(yaxis = list(title = 'Followers Count',
color = '#364E6F'))
fig <- fig %>% layout(xaxis = list(title = 'Date',
color = '#364E6F'))
fig <- fig %>% layout(legend = l)
fig <- fig %>% layout(paper_bgcolor = '#E4EBF5',
plot_bgcolor = '#E4EBF5')
fig
【问题讨论】:
-
有趣的问题。您能否提供示例数据或使用具有月/年作为可用字段的公共数据集?