Closed lucazav closed 1 year ago
I must admit, I fail to see the use case.
At that point, you might as well just store the image output. It's not like you can swap out the data (sensibly) once the plotnine object has been converted to matplotlib instructions.
You obviously can supply 'files' such as this pickle. If you can supply files, you can use pure python packages such as plotnine, by dumping their source and messing with sys.path. It's called 'vendoring'.
Now if you have policies that forbid such vendoring, but allow pickles, your policies with regards to security are likely broken.
Pickles are source-code-that-you-can-not-review.
This out of the scope of this project. Though you can get a matplotlib figure and if you can pickle it and unpickle it in different environments then you have a hack! And it all depends on matplotlib.
p = ggplot() + ...
fig = p.draw()
Thank you for your feedback, guys! I'll try the path suggested by @has2k1
There are closed systems that do not allow you to create custom virtual environments or install packages other than the default ones.
In this case it'd useful to allow to convert a plotnine.ggplot object in a simple matplotlib one, so that you can: