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

Can not display color for render_shapes #359

Open
Lings01 opened this issue Sep 27, 2024 · 1 comment
Open

Can not display color for render_shapes #359

Lings01 opened this issue Sep 27, 2024 · 1 comment

Comments

@Lings01
Copy link

Lings01 commented Sep 27, 2024

I used the example data from spatialdata.scverse.org(xenium_rep1_io) and plot py render_shapes. The plot color fill by na_color.
My code is here:
from spatialdata import bounding_box_query sdata = sd.read_zarr("./data.zarr") crop0 = lambda x: bounding_box_query( x, min_coordinate=[10000, 5000], max_coordinate=[12500, 7500], axes=("x", "y"), target_coordinate_system="global", ) crop0(sdata).pl.render_shapes('cell_boundaries',color='cell_area',table_name = 'table').pl.show(colorbar=True)
image
my packages version is here:
image

@LucaMarconato
Copy link
Member

The gray color appears when the plotted geometries do not have the request annotation (color).

So, assuming that you are not experiencing a bug but the normal behavior, this means that: there is no column in the GeoDataFrame named cell_area and there is not table annotating your geometries that contain a var or obs named cell_area.

I think your table is annotating the labels, you can check this with:

from spatialdata.models import get_table_keys
get_table_keys(sdata['table'])

If that is the case, you can change the target of a table using the code shown in this example from the docs.

Please let me know if this helps solving your issue. If not, we'll look further into this.

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