spatialdata-plot icon indicating copy to clipboard operation
spatialdata-plot copied to clipboard

A couple of fixes to `render_labels`

Open clwgg opened this issue 1 year ago • 0 comments

Fixes #252, #240

This PR includes fixes to two semi-related issues:

  • #252 is addressed in commit d73ccd3

While digging around for a fix to #252, I also did some additional testing which led to:

  • #240 being addressed in commit 377e121

NOTE: I'm not totally sure about the validity of the changes in 377e121, since I can't quite tell which case the else code path is supposed to cover. From my experiments, it seemed like the code path of blending labels_infill and labels_contour could cover all combinations of outline and alpha I tried, but it's absolutely possible I missed something here.

As a comparison, I ran the following commands with and without these commits:

sdata.pl.render_labels(outline=True).pl.show()
sdata.pl.render_labels(outline=True, fill_alpha=1.0).pl.show()

(the corresponding outline=False plots look fine both with and without these changes)

Without these commits, the outputs are: (notice the artifact in the top-left, as reported in #252) main-2 (notice the lack of fill even though alpha=1.0, as reported in #240) main-4

With the fixes included here, the outputs are: dev-2 dev-4

clwgg avatar Apr 24 '24 00:04 clwgg