has2k1 / plotnine

A Grammar of Graphics for Python

Home Page:https://plotnine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adjust_text doesn't work well with facets

skwalker opened this issue · comments

Hi,

First of all, thank you for bring ggplot to python, I love this package :)

I'm having some trouble using adjust_text to make some labels easier to read -- it works very well if you don't plot any facets, but when there is more than 1 facet, it only seems to save the arrow type format in the first facet and then the arrow style/shape gets reset somehow. So for example, it looks something like:

image

This is plotted using ggplot(cluster_corrs, aes(x="i", y="corr", color = "cluster")) + geom_point() + theme_bw() + theme( dpi = 200, legend_position = "none", figure_size=(20, 20)) + geom_text(cluster_corrs.dropna(), aes( label = "label"), adjust_text = {"autoalign": "x", "arrowprops": {"arrowstyle": '-', "color": "black", "lw": 0.2}}, color = "black", size = 8) + facet_wrap("~ cluster")

Is there any way to fix this? (I tried to search similar issues, but couldn't find anything, sorry if this is a dupe). I'm currently using plotnine v0.13.0 (and matplotlib 3.8.2).

Thanks,
Sarah

I could not reproduce this.