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

Stopped working with newer plotnine version #58

Open
nprihodko opened this issue May 13, 2024 · 8 comments
Open

Stopped working with newer plotnine version #58

nprihodko opened this issue May 13, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@nprihodko
Copy link

After upgrading plotnine from 0.12.4 to 0.13.6, patchworklib stopped working with it.

import patchworklib as pw
from plotnine import *
from plotnine.data import *

g1 = pw.load_ggplot(ggplot(mpg, aes(x="cty", color="drv", fill="drv")) + geom_density())

Results in

AttributeError: 'ggplot' object has no attribute '_create_figure'

plotnine==0.13.6
patchworklib==0.6.3

@ponnhide
Copy link
Owner

Apologies for the inconvenience. However, I am unable to continue supporting plotnine in patchworklib due to limited capacity in my labour. I believe patchworklib remains a valuable library even if it only supports matplotlib and seaborn.

If there are many requests like yours, I will consider addressing this issue, but please do not have large expectations..

@ponnhide ponnhide added the enhancement New feature or request label May 13, 2024
@anhhd
Copy link

anhhd commented Jun 17, 2024

Hi @ponnnide,
I would recommend you to continue supporting plotnine as I see that it would help lots of R users moving from ggplot2 ecosystem easier (lots of them use patchwork in R).
You have done awesome work already!
Many thanks!

@almilde
Copy link

almilde commented Jun 20, 2024

I'd like to second the request to keep supporting plotnine. Thank you for your work with all of this.

@ponnhide
Copy link
Owner

ponnhide commented Jun 22, 2024

Probably, plotnine will implement official subplot composer in the future...
Anyway, It is impossible to trace plotnine's updates because its changes in implementations are so huge every time.
The frontend API compatibility among different versions looks good but the backend compatibility totally does not exist. I had make effort until now, but cannot support anymore.
If stable plotnine's version is released and it would not have the patchwork function, I'll update the patchworklib to support the stable plotnine.

@ponnhide
Copy link
Owner

Patchworklib tentatively supports the newest version of plotnine. However, it likely still contains many bugs and may produce unexpected results. If you find anything, please let me know.

@dhimmel
Copy link

dhimmel commented Dec 16, 2024

Possible to bump support to include plotnine 0.14.3 at

'plotnine<=0.13.6',

It seems to work with patchworklib==0.6.5 in the notebook.

Probably, plotnine will implement official subplot composer in the future...

As an eager follower of has2k1/plotnine#46 for years, I hope this comes soon, but in the meantime appreciate everything patchworklib has done!

@dhimmel
Copy link

dhimmel commented Dec 16, 2024

This numpy range is also pretty limiting:

'numpy>=1.16,<1.27',

@oracle5th
Copy link

Thank you for making so much effort to continue supporting plotnine! It really means a lot.

I have encountered an error possibly due to incompatibility between patchworklib==0.6.5 and plotnine==0.13.6.

Traceback (most recent call last):
  File ".../test.py", line 10, in <module>
    pw = pw.hstack(p1, p2)
  File ".../site-packages/patchworklib/patchworklib.py", line 1194, in hstack
    labels_all = list(brick1._labels) + list(brick2._labels)
AttributeError: 'ggplot' object has no attribute '_labels'. Did you mean: 'labels'?

produced by:

import plotnine as gg
import patchworklib as pw

p1 = gg.ggplot()
p2 = gg.ggplot()
pw = pw.hstack(p1, p2)

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

No branches or pull requests

6 participants