1

Using Altair, I'm trying to plot some data from a Dataframe:

plot_N50 = alt.Chart(data).mark_boxplot(opacity=0.5).encode(
    y=alt.Y('N50',  scale=alt.Scale(domain=[0, 35000], clamp=True), axis=alt.Axis(tickCount=9)),
    color=alt.Color('Assembler', scale=alt.Scale(scheme='turbo'), legend=None),
    column=alt.Column('Assembler:N',
        title="",
        header=alt.Header(labelAngle=-45, labelOrient='bottom', labelPadding=-5)
    ),
    row=alt.Row('Amplicon:N',
        title="",
        sort='descending',
    ), 
).configure_axis(
    grid=False,
    labelFontSize=12,
    titleFontSize=12
).configure_view(
    stroke=None
).properties(
    height=height, width=width
)

works fine so far producing the following plot:

N50 plot

would it also be possible to enter a second column (actually the one in the row definition: Amplicon) to get the two plots side by side? In the DF the column Amplicon only has two states. I'm happy to provide any further information.

Thanks in advance

alethomas
  • 11
  • 1
  • 1
    Possible duplicate: https://stackoverflow.com/questions/58627598/how-can-i-arrange-two-faceted-side-by-side-charts-horizontally-in-altair – jakevdp Aug 04 '21 at 16:21
  • Does this answer your question? [How can I arrange two faceted side-by-side charts horizontally in Altair?](https://stackoverflow.com/questions/58627598/how-can-i-arrange-two-faceted-side-by-side-charts-horizontally-in-altair) – joelostblom Aug 16 '21 at 22:52

0 Answers0