-
Notifications
You must be signed in to change notification settings - Fork 633
size argument doesn't always map correctly to marker.size #1479
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
Another example where marker size is incorrect. Confirmed Issue exists in current CRAN version and development version in github. Suspect it occurs when data is not grouped together (ordered by color variable) since it looks ok when the data is grouped by color variable library(plotly)
library(data.table)
#plotly not sizing markers correctly
myiris<-data.table(iris)
#make one species distinctly different
#will use as sizing
myiris[Species=="virginica", Sepal.Width:=Sepal.Width/4]
sizeref <- 2.0 * max(iris$Sepal.Width) / (50**2)
#this version looks like it might be ok?
pg<-plot_ly(myiris,
x=1:nrow(iris),
y=~Sepal.Length,
type="scatter",
mode='markers',
text=~Sepal.Width,
color=~Species,
marker = list(size = ~Sepal.Width, opacity = 0.5, sizemode = 'area', sizeref = sizeref))
pg
|
I think this is due to a different bug that you can avoid by using plot_ly(myiris,
x=1:nrow(iris),
y=~Sepal.Length,
type="scatter",
mode='markers',
text=~Sepal.Width,
color=~Species,
size = ~Sepal.Width, sizes = c(10, 100) * 15) |
Thank you for the quick reply. Your solution looks like it corrects the sizing issue but now there are missing points (where size is expected to be the same as other visible points) when I apply it to real-world data. Probably related to issue you highlighted above? If I use the marker api, I can see all points but need to sort data ahead of time to correct the sizing issues. |
Yea, try using the approach I suggested on your real data with |
The development version of github definitely fixes the issue. Do you know when it will be released to CRAN? I'm trying to bundle with packrat when I deploy to Rconnect but it is still using the global CRAN version that is already installed even though the github version is in my packrat.lock file. Any advise? |
Hopefully this week |
Saw that it was just deployed. You are awesome! |
A minimal example, this should render 10 points, but it only renders 1 currently
Note the current CRAN version (4.8.0) also has this problem
The text was updated successfully, but these errors were encountered: