我试图用plotly来绘制一段时间内的一系列值,但我得到的是非常聚集的日期 . 我想做类似的事情
ggplot中的scale_x_date(date_breaks =“1 month”) .
这是我正在使用的当前代码:
ax <- list(
title = "",
tickformat = "%m-%Y"
)
plot_ly(out,
x = ~date,
y = ~masterTWR,
name = 'Master TWR',
type = 'scatter',
mode = 'lines',
color = I('#054C70')) %>%
add_trace(y = ~cloneTWR,
name = "Clone TWR",
mode = 'lines',
color = I("#05C3DE")) %>%
layout(title = "Account Returns", xaxis = ax, yaxis = list(title = "TWR"), hovermode = 'x')
但即使这样,它仍然给我全年,没有月份,我的x轴没有子集 . 谢谢 .
语言:R