CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Manipulate the direction of spatial plot

Open phoebee-h opened this issue 2 years ago • 1 comments

Hi, Thank you for providing this wonderful tool! (1) It has been working well for me as I followed the tutorial. However, I'm unsure about how to control the orientation of the spatial plot. I've stored the correct coordinates in the cellchat object, but when using netVisual_aggregate, the plot appears rotated unexpectedly. (2) Additionally, the title is absent in netVisual_aggregate when using layout = "circle", and the signal line might be covered by blank. Assigning the "signaling.name" parameter doesn't seem to change anything.

## The direction is correct in cellchat slot.
plot(cellchat@images$coordinates)

image

## It rotates unexpectedly.
netVisual_aggregate(cellchat, signaling = pathways.show, layout = "spatial", edge.width.max = 2, vertex.size.max = 1, alpha.image = 0.2, vertex.label.cex = 3.5)

image

## Title missing?
netVisual_aggregate(cellchat, signaling = pathways.show, layout = "circle", point.size = 2, 
signaling.name="IGF", vertex.label.cex = 1.5)

image

Thank you.

Best, Phoebe

phoebee-h avatar Jan 11 '24 03:01 phoebee-h

@phoebee-h For the orientation of the spatial plot, this issue should be fixed if you simply switch x_cent and y_cent in cellchat@images$coordinates.

For the issue you mentioned in the circle plot, I do notice this issue sometimes. Can you try to add par(mfrow=c(1,1)) before running this function.

sqjin avatar Jan 22 '24 10:01 sqjin