altair icon indicating copy to clipboard operation
altair copied to clipboard

Legend placement on facet chart

Open kuchenrolle opened this issue 5 years ago • 2 comments

Trying to orient a legend on a faceted chart does not seem to work properly.

dat = pd.DataFrame(dict(
    one = [1,2,3,4],
    two = ["1","1","2","2"],
    three = [1,4, 9, 16]))
alt.Chart(dat).mark_line().encode(
    x="one",
    y="three",
    color="two").facet("two").configure_legend(orient="bottom-right")

This should result in the legend being placed on the bottom right, inside the plot, but instead it is at the top left, outside the plot. I get the same behaviour when I directly encode it using altair.Legend inside altair.Color. With facet removed it works fine.

This is on altair 4.1.0 with jupyterlab 2.1.2.

kuchenrolle avatar May 19 '20 17:05 kuchenrolle

This looks like a bug in Vega/Vega-Lite. I'd suggest reporting the issue there.

jakevdp avatar May 19 '20 18:05 jakevdp

VL issue here https://github.com/vega/vega-lite/issues/3931

joelostblom avatar Mar 23 '22 01:03 joelostblom

Closing this as there is nothing to do on the Altair side of things. Once the functionality has been implemented in VL, it will be in an upcoming Altair release.

joelostblom avatar Jan 16 '23 19:01 joelostblom