scverse / scirpy

A scanpy extension to analyse single-cell TCR and BCR data.
https://scirpy.scverse.org/en/latest/
BSD 3-Clause "New" or "Revised" License
206 stars 32 forks source link

Plot overhaul #247

Open grst opened 3 years ago

grst commented 3 years ago

Follow scanpy's plotting conventions more closely.

Supersedes #193.


grst commented 8 months ago

Maybe always return the figure instead of the axes? Seems to work well with jupyter (doesn't show anything similar to "<Axes: title={'center': 'Number of cells in airr:receptor_subtype by gex:source'}, xlabel='airr:receptor_subtype', ylabel='Number of cells'>".

grst commented 5 months ago

Accompany with "plotting cookbook",

grst commented 5 months ago

Something like

def plot_mpl():
    with plt.ioff():
        fig, ax = plt.subplots()
        ax.plot(range(10))
        return fig

works well in Jupyter. It shows the figure and one can use the figure object for saving etc. if one wants to.

If someone works in ipython, they'd need to manually call .show() -- but I think this would be ok.