Changing Size of Legend in Altair
As you have seen, the legend has a default size in pixels that is constant regardless of the size of the chart. If you would like to adjust it, you can use the configure_legend()
chart method.
In Altair 3.0 or later, the following arguments are the relevant ones for adjusting the size of the legend gradient:
chart.configure_legend(
gradientLength=400,
gradientThickness=30
)