-
Notifications
You must be signed in to change notification settings - Fork 236
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
Multicolor/size issues #12
Comments
I think both cases were fixed in the last commit |
In the first example, replace size by 10. Initially, size (or s argument) was a fraction of the box size, but since humans aren't that good with numbers between 0 and 1, I switched to percentages, so 100 is the size of the box/volume, 10 is 10% of it. It will be in the changelog for the next release, sorry for this, that's the fate of early adopters I'm afraid ;). For the 2nd example it's the same, try removing the /10. Also, i'm not adopting matplotlib's short argument names (s versus size), since we have tab-completion in the notebook, and that leads to more readable code. I'm working on examples, stay tuned for the next release.
without having a default colormap/colorscale, it will try to interpret it as rgb values, when a colorscale is set, it will use that. For now you have to use matplotlib's colormaps directly (opacity is ignored): import ipyvolume
import matplotlib.cm
x = np.array([1,2,3,4,5])
y = np.array([2,4,3,2,1])
z = np.array([9,8,3,4,1])
c = matplotlib.cm.afmhot(np.linspace(0, 1, len(x)))
ipyvolume.quickscatter(x, y, z, color=c, size=10, marker="sphere") I'd like to delay colormap/colorscale in ipyvolume until jupyter-widgets/ipywidgets#1153 takes more shape. Let me know if this answer your questions. |
Thanks - it works! |
👍 for letting me know |
Setting colors per datapoint doesn't work:
The result is white spheres in every case.
Also, setting the size doesn't work:
The result is no spheres at all.
Probably I'm misunderstanding the API, but an example would help.
Finally, I think the case where the color is given as a 1D array of floats should be reserved for a colormap, NOT interpreted as an rgb value. By default, the matplotlib default colormap should be used, or a custom colormap given by the parameter
cmap=
.Tagging @jeammimi
The text was updated successfully, but these errors were encountered: