You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There currently is no guide to integrating adjustText into seaborn, a popular matplotlib wrapper.
This is especially detrimental to seaborn.objects() which aims to have the same grammar as ggplot2, but does not have easy options to space out text like ggrepel.
After testing, I have demonstrated that adjustText can be integrated into seaborn.objects() using principles demonstrated from #58 and using seaborn.objects.Plot.on
Generic solution:
# your plot (with subfigures, can be declared by .facet())p=so.Plot().add(so.Text())
f=plt.figure(figsize=(24, 10), dpi=200, layout="constrained")
p.on(f).plot()
# In my instance I was using subplotsforaxinf.axes:
adjust_text(texts=[childforchildinax.get_children() ifisinstance(child,mpl.text.Text)][:-3],ax=ax,arrowprops=dict(arrowstyle='-', color='gray', alpha=.65))
#[:-3] because last three Text objects are x-axis, y-axis, and title respectively.
Lastly, regarding the questions about time discrepancy between subplots raised in #58, initially setting a random arbitrary Text location helps speed up the process on my instance.
so.Text(valign='top')
I will push a full example .ipynb once I finish my paper...
The text was updated successfully, but these errors were encountered:
There currently is no guide to integrating adjustText into seaborn, a popular matplotlib wrapper.
This is especially detrimental to seaborn.objects() which aims to have the same grammar as ggplot2, but does not have easy options to space out text like ggrepel.
After testing, I have demonstrated that adjustText can be integrated into seaborn.objects() using principles demonstrated from #58 and using seaborn.objects.Plot.on
Generic solution:
Lastly, regarding the questions about time discrepancy between subplots raised in #58, initially setting a random arbitrary Text location helps speed up the process on my instance.
I will push a full example .ipynb once I finish my paper...
The text was updated successfully, but these errors were encountered: