Commit e4d3f9c
committed
Fix flat hue in categorical density: drop min_alpha floor
For categorical density the only signal available to encode count is
per-pixel alpha (hue is fixed per category by the color key). The
existing min_alpha of ~254 (set so scatter plots render every point at
full opacity) clamps that signal to a single value, so all three
gene clusters were rendering as flat, uniform blobs.
Under density=True the categorical shade path now uses min_alpha=40
(~15%): low enough to give the count-driven alpha real range, high
enough to keep sparse-edge pixels visible under density_how="linear".
Plain density (continuous shade path) is unaffected -- its viridis
gradient already encodes count via hue.1 parent 809c156 commit e4d3f9c
4 files changed
Lines changed: 10 additions & 1 deletion
File tree
- src/spatialdata_plot/pl
- tests/_images
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
| |||
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
292 | 300 | | |
293 | 301 | | |
294 | 302 | | |
295 | 303 | | |
296 | 304 | | |
297 | | - | |
| 305 | + | |
298 | 306 | | |
299 | 307 | | |
300 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| 1108 | + | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | 1111 | | |
| |||
Binary file not shown.
Binary file not shown.
0 commit comments