Skip to content

spurious warning when mapping marker size #1367

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

Open
wibeasley opened this issue Oct 12, 2018 · 2 comments
Open

spurious warning when mapping marker size #1367

wibeasley opened this issue Oct 12, 2018 · 2 comments

Comments

@wibeasley
Copy link
Contributor

The simple scatterplot has a third variable mapped to the marker/point size. The plot looks perfect to me, but it throws a warning about multiple values. Each x & y value has exactly one size value.

Other than suppressing the warning, can a respecify this graph so it does not throw the warning?

Warning message:
`line.width` does not currently support multiple values.

Code:

plotly::plot_ly(
  data  = iris, 
  x     = ~Sepal.Length, 
  y     = ~Petal.Length, 
  size  = ~Sepal.Width,
  type  = 'scatter', 
  mode  = 'markers'
)

Graph:
scatterplot

Originally posted at https://stackoverflow.com/questions/52692760/spurious-warning-when-mapping-marker-size-in-plotly-r.

@julistanley
Copy link
Contributor

julistanley commented May 18, 2020

I'm getting the same warning on a custom dataset, in case that's related. I'll put a reprex below: should I be getting a warning about multiple values? I'm not sure how to interpret that.

Reprex:

test <- structure(list(Expected = c(0.30335, 0.81325, 0.61766, 0.16683, 
0.78723, 0.7299), Score = c(3.575, 4.959, 5.605, 4.033, 6.574, 
4.35), Population = c(38928.341, 2877.8, 43851.043, 32866.268, 
45195.777, 2963.234)), row.names = c(NA, 6L), class = "data.frame")

test %>%
  plot_ly(x = ~Expected, y = ~Score) %>%
  add_markers(size = ~Population)

Produces warning:

Warning message:
`line.width` does not currently support multiple values.

Plot looks as expected:

image

@LukasWallrich
Copy link

For anyone facing this issue: as reported on StackOverflow, the warning goes away with setting fill = ~''. The poster there also isolated the lines of code that cause this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants