Coder Social home page Coder Social logo

Anything to do about plt.subplot about scirpy HOT 4 CLOSED

UboCA avatar UboCA commented on August 17, 2024
Anything to do about plt.subplot

from scirpy.

Comments (4)

UboCA avatar UboCA commented on August 17, 2024

I just realized scirpy has used plt.subplot to draw abundance bar plot.
So reusing plt.subplot may not work.

But how could I merge several plot objects from scirpy?

from scirpy.

UboCA avatar UboCA commented on August 17, 2024

Other observation while I using ir.pl.group_abundance is that legend will be resorted by single pair cell number.

ir.pl.group_abundance(adata, groupby='chain_pairing', target_col='seurat_clusters', normalize=True, sort 
= 'count')

image
You can see seurat_clusters {0...8} are reordered by chain_pairing value.
But what if one want to keep original catgeories? For this reason, to bring an order parametre could make it more friendly.

from scirpy.

grst avatar grst commented on August 17, 2024

Hi @UboCA,

thanks for reporting this issue. Actually, I'm a bit surprised that this hasn't surfaced earlier.
With the fix in #379, you should be able to do

adata = ir.datasets.wu2020_3k()
fig, (ax1, ax2) = plt.subplots(1,2, figsize=(12, 4), gridspec_kw={"wspace": 1})
ir.pl.group_abundance(adata, groupby='cluster_orig', target_col='patient',ax=ax1)
ir.pl.group_abundance(adata, groupby='cluster_orig', target_col='source',ax=ax2)

image

Could you give it a try? You can install the development version using

pip install git+https://github.com/scverse/scirpy@master

Regarding your second suggestion, there's a long-outstanding issue for that: #186
It should be an easy fix and I'm happy to take a PR. Otherwise I'll look into this once the mega PR #356 is complete.

from scirpy.

UboCA avatar UboCA commented on August 17, 2024

Got it, many thanks.

Best

from scirpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.