Skip to content
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

Add a scatter (2d) plot? #264

Closed
nvaytet opened this issue Sep 26, 2023 · 5 comments · Fixed by #317
Closed

Add a scatter (2d) plot? #264

nvaytet opened this issue Sep 26, 2023 · 5 comments · Fixed by #317
Labels
enhancement New feature or request

Comments

@nvaytet
Copy link
Member

nvaytet commented Sep 26, 2023

Would look like:

img

@nvaytet nvaytet added the enhancement New feature or request label Sep 26, 2023
@nvaytet
Copy link
Member Author

nvaytet commented Sep 26, 2023

What kind of API?

Would be nice to be able to call pp.scatter(x, y, z) where z is for the color.

In scatter3d, x, and y can only be strings. Should we consider allowing either strings or variables?
-> if they are strings, look up the coordinates in z, if they are variables, use as is?

This would mean that z could be optional if both x and y are variables.

@nvaytet
Copy link
Member Author

nvaytet commented Sep 26, 2023

What kind of API?

Would be nice to be able to call pp.scatter(x, y, z) where z is for the color.

In scatter3d, x, and y can only be strings. Should we consider allowing either strings or variables? -> if they are strings, look up the coordinates in z, if they are variables, use as is?

This would mean that z could be optional if both x and y are variables.

I don't think this works when we want to update data on an existing scatter plot.
If a view receives new data, it will be a data array where potentially both color values and x,y positions have changed.
So the x and y must be strings (set once and for all when the plot is created) that pick coordinates in the data array it receives upon update.

@nvaytet
Copy link
Member Author

nvaytet commented Sep 26, 2023

So it would have to be like the scatter3d plot:

pp.scatter(da, x='time', y='cost')

@nvaytet
Copy link
Member Author

nvaytet commented Sep 26, 2023

If you want to make a scatter plot using just two variables, and no color, this is covered by the new xyplot.

@nvaytet
Copy link
Member Author

nvaytet commented Sep 28, 2023

So it would have to be like the scatter3d plot:

I am no longer so sure about this. Maybe we can allow supplying colors and positions as separate variables, instead of all being bundled up in a single data array.
You can pass nodes to the xyplot and then update only the y values by changing the data in the corresponding node.
So we could do the same for the scatter plots.

Then maybe the xyplot is not needed, and it is just a scatter plot?
Or maybe it is needed because right now it supports making line plots, and also if the x coordinate is bin edges.

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

Successfully merging a pull request may close this issue.

1 participant