我将颜色编码到了我的绘图直方图中,但是代码似乎没有使用该颜色。如果我运行代码,它只会为我提供默认的蓝色和橙色。多谢您的帮助
xbins <- list(start=4.25, end=5.60, size=0.1) plotbefore <-
plot_ly(alpha = 0.6) %>% add_histogram(
x = st_wage_before_nj,
xbins = xbins,
histnorm = "percent",
name = "Wage Before in NJ",
marker = list(color = "teal",
line=list(color="darkgray", width=2))) %>%
add_histogram(
x = st_wage_before_pa,
xbins = xbins,
histnorm = "percent",
name = "Wage Before in PA") %>%
layout(
barmode = "group",
title = "February 1992 before Minimumwage",
xaxis = list(tickvals=seq(4.25, 5.55, 0.1),
title = "Wage in $/h"),
yaxis = list(range = c(0, 50)),
margin = list(b = 100,
l = 80,
r = 80,
t = 80,
pad = 0,
autoexpand = TRUE)
如何获取代码以绘制颜色打算的颜色? (纳姆尔蓝绿色和深灰色系)?