CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Two plots instead of one in Jupyter

Open f6v opened this issue 10 months ago • 3 comments

Hi,

I'm using Jupyter lab to run the CellChat code. For some reason, the plots are duplicated, e.g. when I do this:

netVisual_diffInteraction(cellchat_combined, weight.scale = T)

I get the following output:

Image

What could be the reason? Thanks in advance!

f6v avatar Mar 04 '25 09:03 f6v

@f6v Sorry. I just have no idea to use in Jupyter.

sqjin avatar Mar 16 '25 08:03 sqjin

I also get duplicated plots when using netVisual_circle() in RStudio Quarto with Chunk Output Inline selected.

AlbertoFabbri93 avatar Mar 17 '25 10:03 AlbertoFabbri93

For me, this resolved when I would store the output of netVisual_xxx in a variable

ie gg <- netVisual_aggregate(cellChat, signaling = pathways.show, layout = "chord") instead of netVisual_aggregate(cellChat, signaling = pathways.show, layout = "chord")

Perhaps this is because the visualization functions are already plotting internally and also return the plot (hence are plotting twice if you don't store the output).

dkzhang777 avatar Oct 17 '25 02:10 dkzhang777