Commit 4154499
committed
fix(as_points): size datashader canvas to the axes, not the figure
The datashader result is a data-coordinate image that scales with the axes,
while matplotlib markers are fixed in display points. The canvas was sized from
fig.get_size_inches()*dpi (the whole figure), but the axes are smaller (margins,
colorbar), so the image - and every dot - was scaled down: labels (with colorbar)
0.81x matplotlib, shapes 0.88x. Size the as_markers canvas to the axes display box
(ax.get_window_extent()) so 1 canvas px == 1 axes-display px and the sqrt(s)*dpi/144
spread radius matches the marker. Now mean 0.99 +/-5% across sizes/figs/dpi/elements;
render_points untouched (byte-identical). Visual tests render at a non-overlapping
size so the engines' overlap handling (stack vs aggregate) doesn't enter the pairs.1 parent b7e2fd6 commit 4154499
3 files changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
1258 | 1257 | | |
1259 | 1258 | | |
1260 | 1259 | | |
1261 | | - | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1262 | 1265 | | |
1263 | 1266 | | |
1264 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1265 | 1271 | | |
1266 | 1272 | | |
1267 | 1273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
1114 | | - | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1115 | 1117 | | |
1116 | 1118 | | |
1117 | 1119 | | |
| |||
0 commit comments