내가하고 싶은 대화 (즉, 그들은 상자/올가미 선택을 선택할 수 있습니다 의미) 지터 점이 상자 그림 그룹화 된 에 표시합니다. 나는이 질문에서 나온 것이다 : Add jitter to box plot using markers in plotly. 나는 정확히 같은 것을 원하지만 boxplots은 그룹화되어야합니다.추가 지터는 plotly
는 내가 상자 그림으나 포인트는 모두 혼합되어
dat %>%
plot_ly(x = ~as.numeric(IC),
y = ~xval,
color = ~gene,
type = "box",
hoverinfo = "none",
boxpoints = FALSE
) %>%
add_markers(x = ~jitter(as.numeric(IC)),
y = ~xval,
color = ~gene,
marker = list(size = 3),
hoverinfo = "text",
text = txt,
showlegend = TRUE) %>%
layout(boxmode = "group")
은 내가 할 수 없습니다 (각 조합은 수평이되도록) 요인에 의해 그룹화 된 X 축을하려고 할 때 내 상자 그림 그룹화 :
dat <- dat %>%
mutate(gene_x_covariate = as.factor(
paste0(get(facet_title), "-", gene)))
dat %>%
plot_ly(x = ~as.numeric(gene_x_covariate),
y = ~xval,
color = ~gene,
type = "box",
hoverinfo = "none",
boxpoints = FALSE
) %>%
add_markers(x = ~jitter(as.numeric(gene_x_covariate)),
y = ~xval,
color = ~gene,
marker = list(size = 3),
hoverinfo = "text",
text = txt,
showlegend = TRUE) %>%
layout(boxmode = "group")
,691 나는 X 축에 변수를 혼합 할 때, 나는 상자 그림에서 멀리 포인트를 얻을 :
dat %>%
plot_ly(x = ~as.numeric(IC),
y = ~xval,
color = ~gene,
type = "box",
hoverinfo = "none"
) %>%
add_markers(x = ~jitter(as.numeric(gene_x_covariate)),
y = ~xval,
color = ~gene,
marker = list(size = 3),
hoverinfo = "text",
text = txt,
showlegend = TRUE) %>%
layout(boxmode = "group")
어떤 아이디어?
일부 예제 데이터를 게시 할 수 있습니까? – aocall