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
{{ message }}
Repository navigation
[bug] Add a recovery function for the overwrite_axisgrid #63
Great work, thanks for open source! It greatly facilitates the drawing needs of the academic community!
I have located a small bug during the use process. I hope you can handle it when you have time. I am very grateful!
After applying the overwrite_axisgrid function to override the default SNS settings, if you continue to plot and save with SNS, the problem shown in the following figure will occur, so it is best to add a function to restore the default SNS Grid settings.
# Comment load_seaborngrid code# g2 = pw.load_seaborngrid(g2) # Save the original Seaborn Grid Figure directlyg2.savefig("test.svg")
result
Problematic code
defoverwrite_axisgrid():
""" Overwrite `__init__` functions in seaborn.axisgrid.FacetGrid, seaborn.axisgrid.PairGrid and seaborn.axisgrid.JointGrid. The function changes the figure object given in the `__init__` functions of the axisgrid class objects, which is used for drawing plots, to `_basefigure in the patchworklib. If you want to import plots generated baseon seabron.axisgrid.xxGrid objects as patchworklib.Brick(s) object by using `load_seaborngrid` function, you should execute the function in advance. Returns ------- None. """#sns.pairplot = mg.pairplotsns.axisgrid.Grid._figure=_basefiguresns.axisgrid.Grid.add_legend=mg.add_legendsns.axisgrid.FacetGrid.__init__=mg.__init_for_facetgrid__sns.axisgrid.FacetGrid.despine=mg.despinesns.axisgrid.PairGrid.__init__=mg.__init_for_pairgrid__sns.axisgrid.JointGrid.__init__=mg.__init_for_jointgrid__sns.matrix.ClusterGrid.__init__=mg.__init_for_clustergrid__sns.matrix.ClusterGrid.__setattr__=mg.__setattr_for_clustergrid__sns.matrix.ClusterGrid.plot=mg.__plot_for_clustergrid__
Activity