-
Notifications
You must be signed in to change notification settings - Fork 633
add_trace
inherits properties in this example
#280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If you don't want zcol = c(1, 3, 2)
textcol = c('A', 'B', 'C')
countrycol = c('Canada', 'Egypt', 'USA')
locationscol = c('CAN', 'EGY', 'USA')
df = data.frame(z=zcol, text=textcol, country=countrycol, locations=locationscol)
p <- plot_ly(df, z = z, text = text, locations = locations, type = 'choropleth', inherit = FALSE) %>%
add_trace(type="scattergeo", mode="text")
fig <- p %>% plotly_build
fig$data[[2]]
#> $type
#> [1] "scattergeo"
#>
#> $mode
#> [1] "text" Do you think the default should be |
ahhh got it. Not sure about the default, but I think
In this case, the user might've forgotten to add |
I'm starting to agree that library(plotly)
library(dplyr)
p <- iris %>%
count(Species) %>%
plot_ly(x = Species, y = n, opacity = 0.5, type = "bar") %>%
layout(barmode = "overlay", showlegend = FALSE)
s <- count(iris[sample(nrow(iris), 10), ], Species)
add_trace(p, data = s) versus add_trace(p, x = Species, y = n, data = s) |
the second trace should only have
"type"
and"mode"
keys, but instead:The text was updated successfully, but these errors were encountered: