Skip to content

Categorical data is now correctly colored in the legend when plotting v2 #323

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

Conversation

timtreis
Copy link
Member

@timtreis timtreis commented Aug 15, 2024

Successor of #262 to avoid solving unneccecary merge conflicts due to age

@timtreis timtreis linked an issue Aug 15, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 81.53846% with 24 lines in your changes missing coverage. Please review.

Project coverage is 79.27%. Comparing base (ac4f287) to head (9ae69e9).
Report is 3 commits behind head on main.

Files Patch % Lines
src/spatialdata_plot/pl/utils.py 75.58% 21 Missing ⚠️
src/spatialdata_plot/pl/render.py 90.32% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
- Coverage   80.34%   79.27%   -1.08%     
==========================================
  Files          11       11              
  Lines        1745     1785      +40     
==========================================
+ Hits         1402     1415      +13     
- Misses        343      370      +27     
Files Coverage Δ
src/spatialdata_plot/pl/basic.py 90.90% <100.00%> (ø)
src/spatialdata_plot/pl/render_params.py 100.00% <100.00%> (ø)
src/spatialdata_plot/pl/render.py 94.80% <90.32%> (+0.83%) ⬆️
src/spatialdata_plot/pl/utils.py 67.88% <75.58%> (-2.29%) ⬇️

@timtreis timtreis mentioned this pull request Aug 27, 2024
@timtreis timtreis requested a review from melonora August 27, 2024 18:48
@timtreis timtreis merged commit e97a7fc into main Aug 28, 2024
5 checks passed
@timtreis timtreis deleted the bugfix/issue214-categorical-data-is-incorrectly-colored-in-the-legend-when-plotting-2 branch August 28, 2024 01:25
if (render_params.fill_alpha != render_params.outline_alpha) and render_params.contour_px is not None:
# First get the labels infill and plot them
# default case: no contour, just fill
# if fill_alpha and outline_alpha are the same, we're technically also at a no-outline situation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timtreis Probably just an edge case, but if the user increases the outline width when fill_alpha == outline_alpha one would expect the labels to get bigger which would not happen since it's treated as no-outline, correct?

Copy link
Member Author

@timtreis timtreis Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, yes, that's true. Will send follow-up PR to cover this edge case. Good catch!

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

Successfully merging this pull request may close these issues.

Categorical Data is incorrectly colored in the legend when plotting
3 participants