We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_html
See screenshots, along with the following snippet to reproduce. I have a slight suspicion this is related to #3435.
With to_html:
Without to_html:
import altair as alt import numpy as np import pandas as pd from altair.utils._show import open_html_in_browser A = np.array([[50, 0, 0], [0, 48, 2], [0, 2, 48]]) data = pd.DataFrame( ((i, j, v) for (i, j), v in np.ndenumerate(A)), columns=["i", "j", "v"] ) chart = ( alt.Chart(data, title="Confusion matrix") .mark_rect() .encode( x=alt.X("i:O", axis=alt.Axis(orient="top"), title="Predicted class"), y=alt.Y("j:O", title="True class"), color="v:Q", ) .properties(width=400, height=400) ) # only shows one plot open_html_in_browser(f"{chart.to_html()} {chart.to_html()}") def altair_to_html(chart): from altair.vegalite.v5.display import html_renderer return html_renderer(chart.to_dict())["text/html"] # correctly shows 2 plots open_html_in_browser(f"{altair_to_html(chart)} {altair_to_html(chart)}")
Both methods should have the same behavior.
5.3.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What happened?
See screenshots, along with the following snippet to reproduce.
I have a slight suspicion this is related to #3435.
With
to_html
:Without
to_html
:What would you like to happen instead?
Both methods should have the same behavior.
Which version of Altair are you using?
5.3.0
The text was updated successfully, but these errors were encountered: