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

How to add points to existing plot with scattermoreplot? #23

Open
scienception opened this issue Oct 24, 2023 · 4 comments
Open

How to add points to existing plot with scattermoreplot? #23

scienception opened this issue Oct 24, 2023 · 4 comments
Labels
question Further information is requested

Comments

@scienception
Copy link

I created a plot with scattermoreplot, and want to add additional points in every for loop iteration.
Is there such functionality such as adding points() to a plot() plot?

@exaexa
Copy link
Owner

exaexa commented Oct 24, 2023

Hi, yes there is. There are a few ways to do that:

The best way probably depends on your use-case -- what are (roughly) the point amounts that you want to add in each iteration?

@exaexa
Copy link
Owner

exaexa commented Oct 24, 2023

PS I just realized we also have a vignette that contains some relevant code -- the merging of the intermediate layers is described roughly around here: https://exaexa.github.io/scattermore/articles/low_level_interface.html#merging-rgbwt-and-rgba-layers

@scienception
Copy link
Author

Thank you! Is it possible to pass a vector for pointsize in geom_scattermost(count_pairs_matrix, pointsize=2)?
I need the points to have variable size (depending on some count). Basically I want the size of the point to increment with how many observations for that (x,y) point I got.

@exaexa
Copy link
Owner

exaexa commented Oct 24, 2023

no, unfortunately not, the API is made for single-pixel operations only (for speed) and you are supposed to expand the points after that. (The logic there is that for actual big data, expanding single pixels is much faster than plotting lots if large points.)

The options are:

As a quick question, how many points (roughly) are you plotting in total? Scattermore is specialized for amounts where point sizes typically do not matter anymore; which is exactly why doing "precise" stuff like this gets complex.

Cf. this issue: #18

@exaexa exaexa added the question Further information is requested label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants