Skip to content

Multiline text in mark_text? #2674

Answered by joelostblom
arogozhnikov asked this question in Q&A
Discussion options

You must be logged in to vote

mark_text works the same as axes labels and titles. Pandas columns that contain lists will be split onto multiple lines (works for both string and numbers):

import pandas as pd
import altair as alt


alt.Chart(pd.DataFrame({'a': [['one', 'two']]})).mark_text().encode(
    x=alt.value(0),
    y=alt.value(0),
    text='a'
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@arogozhnikov
Comment options

Answer selected by arogozhnikov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants