Skip to content

Commit 5efddfb

Browse files
committed
Compact compliance heatmap legend
1 parent 7afdc2d commit 5efddfb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/carwatch/plotting.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,14 @@ def _plot_compliance_heatmap(
540540
norm=norm,
541541
linewidths=0.35,
542542
linecolor="white",
543-
cbar_kws={"ticks": [-1, 0, 1]},
543+
# The heatmap can be tall when many participants are shown. Keep this
544+
# categorical key compact instead of matching the heatmap height.
545+
cbar_kws={"ticks": [-1, 0, 1], "shrink": 0.35, "aspect": 12, "pad": 0.02},
544546
ax=ax,
545547
)
546548
colorbar = heatmap.collections[0].colorbar
547549
colorbar.set_ticklabels(["Non-compliant", "Unassessed", "Compliant"])
550+
colorbar.ax.tick_params(labelsize="small", length=2, pad=2)
548551
_apply_axis_options(
549552
ax,
550553
axis_options,

0 commit comments

Comments
 (0)