Skip to content

Fixed bug because of which extent of previous axs was not respected#101

Merged
timtreis merged 5 commits intomainfrom
bugfix/issue100-get_extent-produces-wrong-output-after-spatial-query
Jun 29, 2023
Merged

Fixed bug because of which extent of previous axs was not respected#101
timtreis merged 5 commits intomainfrom
bugfix/issue100-get_extent-produces-wrong-output-after-spatial-query

Conversation

@timtreis
Copy link
Member

Fixes issue 100

@timtreis timtreis linked an issue Jun 13, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2023

Codecov Report

Merging #101 (cdf4382) into main (b84c1ab) will increase coverage by 5.83%.
The diff coverage is 87.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   70.54%   76.37%   +5.83%     
==========================================
  Files           9        9              
  Lines        1117     1143      +26     
==========================================
+ Hits          788      873      +85     
+ Misses        329      270      -59     
Impacted Files Coverage Δ
src/spatialdata_plot/pl/utils.py 63.40% <75.00%> (+7.11%) ⬆️
src/spatialdata_plot/pl/basic.py 83.88% <92.00%> (+0.55%) ⬆️

... and 2 files with indirect coverage changes

@timtreis
Copy link
Member Author

timtreis commented Jun 13, 2023

@jefferyUstc, could you verify if the branch from this PR fixes your issue with the spatial_query notebook? You should be able to install it with

pip install -U git+https://github.com/scverse/spatialdata-plot.git@bugfix/issue100-get_extent-produces-wrong-output-after-spatial-query

@timtreis timtreis self-assigned this Jun 13, 2023
@timtreis timtreis added the bug Something isn't working label Jun 13, 2023
@jefferyUstc
Copy link

@jefferyUstc, could you verify if the branch from this PR fixes your issue with the spatial_query notebook? You should be able to install it with

pip install -U git+https://github.com/scverse/spatialdata-plot.git@bugfix/issue100-get_extent-produces-wrong-output-after-spatial-query

thank you, I'll try ASAP.

@jefferyUstc
Copy link

Hi, generally it works now.
I re-rerun the tutorial codes:

image

@timtreis
Copy link
Member Author

timtreis commented Jun 14, 2023

Thank you for pointing out the mismatch between plot and legend, I opened a new issue to address this: #104

What do you mean with your second annotation? The fact that the plot border overlaps the points at the edge? I added a pad_extent argument to the pl.show() function to combat this, if wanted. You can use it as follows:

f, ax = plt.subplots(figsize=(7, 7))
sdata_ST8059048.pl.render_shapes().pl.show(ax=ax)
cropped_sdata.pl.render_shapes(color="Sox2").pl.show(ax=ax, colorbar=True, pad_extent=50)

# show the spatial query bounding box
rect = patches.Rectangle((8000, 12000), 4000, 4000, linewidth=5, edgecolor="k", facecolor="none")
ax.add_patch(rect)
image

@timtreis timtreis requested a review from LucaMarconato June 20, 2023 23:38
@timtreis timtreis merged commit bde6827 into main Jun 29, 2023
@timtreis timtreis deleted the bugfix/issue100-get_extent-produces-wrong-output-after-spatial-query branch June 29, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_extent produces wrong output after spatial query

3 participants