We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I can not manage to specify both the size and the color mapping with completely satisfactory results.
If I specify the size mapping globally:
library(plotly) df <- data.frame(x = 1:12, y = 1:12, s = 1:12, g = rep(c("A", "B", "C"), 4)) plot_ly(data = df, x = ~x, y = ~y, size = ~s, color= ~g)%>% add_markers()
I have a perfect plot but I suffer from the spurious line.width warning already mentioned in #1367
line.width
If I specify the size mapping in the marker itself:
plot_ly(data = df, x = ~x, y = ~y, color= ~g)%>% add_markers(marker = list(size = ~s))
The sizes are wrong: it seems there is an ordering by group within plotly which is not used in the markers.
Indeed, sorting the data.frame according to the colors fixes the issue:
df_sorted = df[order(df[['g']]), ] plot_ly(data = df_sorted, x = ~x, y = ~y, color= ~g)%>% add_markers(marker = list(size = ~s))
Let me know how I can help!
The text was updated successfully, but these errors were encountered:
I had the same issue and it drove me crazy. That comment really saved me. "... sorting the data.frame according to the colors fixes the issue" Thanks!
Sorry, something went wrong.
thanks, help a lot
No branches or pull requests
Hi,
I can not manage to specify both the size and the color mapping with completely satisfactory results.
If I specify the size mapping globally:
I have a perfect plot but I suffer from the spurious
line.width
warning already mentioned in #1367If I specify the size mapping in the marker itself:
The sizes are wrong: it seems there is an ordering by group within plotly which is not used in the markers.
Indeed, sorting the data.frame according to the colors fixes the issue:
Let me know how I can help!
The text was updated successfully, but these errors were encountered: