Closed TyberiusPrime closed 11 months ago
I found a workaround by subclassing my target geom, and yes it does indeed raster the output correctly.
class geom_point_rastered(p9.geom_point):
def draw_panel(self, data, panel_params, coord, ax, **params):
params['raster'] = True
super().draw_panel(data, panel_params, coord, ax, **params)
That shouldn't be the final API though ;).
The raster
parameter is documented. It is part of the layer, the default value is False
but all geoms
can set it e.g. raster=True
My apologies, I must have been looking at an alternative history version of plotnine or something.
Could've sworn the search on the docs only lead me to the source code yesterday.
But test case has been there for years, and the docs and the change log do list it.
I need to dump a few thousand data points in an svg (or pdf), and would presumably be benefiting from https://matplotlib.org/stable/gallery/misc/rasterization_demo.html for my use case.
I can tell from the code that plotnine is passing (in geom_point for example) rasterized=params['raster'] to the ax object.
Is that the same thing? And how do I set that params-parameter. It's currently not in the docs and there's no test case with rasterized in it either.
Thank you!