Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdata.pl.render_points() works weird #320

Closed
wangjiawen2013 opened this issue Aug 13, 2024 · 2 comments
Closed

sdata.pl.render_points() works weird #320

wangjiawen2013 opened this issue Aug 13, 2024 · 2 comments

Comments

@wangjiawen2013
Copy link

wangjiawen2013 commented Aug 13, 2024

Hi,
I find sdata.pl.render_points() works wiered when using the default datashader method. Maybe there there something wrong when processing the coordinates for datashader.
The output of sdata.pl.render_points("transcripts", color="feature_name", groups="A2M", size=100, palette="orange").pl.show():
image

The output of sdata.pl.render_shapes("cell_boundaries", color="A2M").pl.render_points("transcripts", color="feature_name", groups="A2M", size=100, palette="orange").pl.show() is similiar, the coordinate of transcripts is global:
image

The output of sdata.pl.render_shapes("cell_boundaries", color="A2M").pl.render_points("transcripts", color="feature_name", groups="A2M", method="matplotlib", palette="orange").pl.show() worked well:
image

Here is my spatialdata object:
image

@LucaMarconato
Copy link
Member

LucaMarconato commented Aug 13, 2024

Thanks for the details. You are correct, there is problem with datashader which I reported here #291 and is currently being worked on. In the issue I posted a workaround (transform the points data before plotting).

Regarding the axis name, we do not plan to automatically write spatial; but if you are interested it you can for instance do

import matplotlib.pyplot as plt

plt.figure()
ax = plt.gca()
sdata.pl.render_shapes(...).pl.show(ax=ax)
ax.set_xlabel('X-axis label')
ax.set_ylabel('Y-axis label')
plt.show()

Closing the issue as duplicate of #291.

@LucaMarconato
Copy link
Member

CC @timtreis

@timtreis timtreis changed the title sdata.pl.render_points() works wiered sdata.pl.render_points() works weird Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants