【发布时间】:2022-01-06 22:50:54
【问题描述】:
在下面的图表中,我只想显示 y 轴的正值而不是负值。
df<-data.frame(
Country<-"AL",
Year<-2003,
Scope<-0
)
library(plotly)
fig <- plot_ly(
data = df,
x = ~ Year,
y = ~ Scope,
type = "scatter",
mode = "lines+markers",
marker = list(
size = 10,
color = 'rgba(255, 182, 193, .9)',
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2)
),
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2)
) %>% layout(
title = "Count of Scope per country and year",
xaxis = list(
dtick = 5
),
yaxis = list(
dtick = 1,
tick0 = 0
)
)
fig
【问题讨论】: