Open scienception opened 1 year ago
Hi, yes there is. There are a few ways to do that:
scattermore()
function to plot into a bitmap and then add the bitmap to the output using e.g. R function rasterImage
or so.scatter_points_rgbwt
to rasterize the point set into an intermediate format (see https://exaexa.github.io/scattermore/reference/scatter_points_rgbwt.html), merge multiple rasters using merge_rgbwt
(https://exaexa.github.io/scattermore/reference/merge_rgbwt.html) and in the end convert the whole thing to a plottable bitmap using these 2 things: https://exaexa.github.io/scattermore/reference/rgbwt_to_rgba_int.html and https://exaexa.github.io/scattermore/reference/rgba_int_to_raster.htmlThe best way probably depends on your use-case -- what are (roughly) the point amounts that you want to add in each iteration?
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
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.
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: https://github.com/exaexa/scattermore/issues/18
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?