Skip to content

Stopped working with newer plotnine version #58

Open

Description

@nprihodko

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

Activity

  1. ponnhide commented on May 13, 2024

    @ponnhide
    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..

  2. anhhd commented on Jun 17, 2024

    @anhhd

    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!

  3. almilde commented on Jun 20, 2024

    @almilde

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

  4. ponnhide commented on Jun 22, 2024

    @ponnhide
    Owner

    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.

  5. ponnhide commented on Oct 12, 2024

    @ponnhide
    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.

  6. dhimmel commented on Dec 16, 2024

    @dhimmel

    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!

  7. dhimmel commented on Dec 16, 2024

    @dhimmel

    This numpy range is also pretty limiting:

    'numpy>=1.16,<1.27',

  8. oracle5th commented on Jan 20, 2025

    @oracle5th

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions