-
Notifications
You must be signed in to change notification settings - Fork 622
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
Properties from second add_trace()
are ignored
#790
Comments
This is sort of a quirk/undocumented, but scales should be specified when initiating the object plot_ly(colors = c("g1" = "green", "g2" = "red"), sizes = 30*c(1,4)) %>%
add_lines(data = dat1, x=~x, y=~y, color = I("blue")) %>%
add_markers(data = dat2, x=~x, y=~y, color = ~group, size = ~(abs(x)+1)) |
@cpsievert I cannot believe I just now found this post. The One can also use symbols by setting the following plot_ly(colors = c("g1" = "green", "g2" = "red"), symbols = c("g1" = "circle", "g2" = "square"), sizes = 30*c(1,4)) %>%
add_lines(data = dat1, x=~x, y=~y, color = I("blue")) %>%
add_markers(data = dat2, x=~x, y=~y, color = ~group, symbol = ~group, size = ~(abs(x)+1)) To also change the size of the marker (for when doing plot_ly(colors = c("g1" = "green", "g2" = "red"), symbols = c("g1" = "circle", "g2" = "square"), sizes = 30*c(1,4)) %>%
add_lines(data = dat1, x=~x, y=~y, color = I("blue")) %>%
add_markers(data = dat2, x=~x, y=~y, color = ~group, symbol = ~group, size = ~(abs(x)+1), marker = list(size = 20)) The thing that confuses me is why I cannot use the marker attribute to also set the symbol and color such as in the following manner: |
In the example below, the
colors
andsizes
attributes withinadd_markers()
are ignored.If
add_lines(data = dat1, x=~x, y=~y, color = I("blue")) %>%
is removed, then the markers are rendered perfectly. The same issue occurs ifplot_ly()
is replaced withplot_geo()
.The text was updated successfully, but these errors were encountered: