Replies: 3 comments
-
Did you try |
Beta Was this translation helpful? Give feedback.
-
I am able to get the chart to a HTML file using:
Still, I wonder how to get the to the browser interface, i.e. |
Beta Was this translation helpful? Give feedback.
-
Good question. I remember it is possible, and found the corresponding PR again, it is here: #3379. If you are on Altair version 5.3.0 or later this should be possible. When I place the following python code in a file named import altair as alt
import pandas as pd
alt.renderers.enable("browser", using="safari", port=3001)
source = pd.DataFrame({
'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
chart = alt.Chart(source).mark_bar().encode(
x='a',
y='b'
)
chart.show() See also the following recording from a terminal within Jupyter-lab (I tried the normal terminal as well and that also works for me) Screen.Recording.2025-02-01.at.20.35.08.movRelevant docs are here: https://altair-viz.github.io/user_guide/display_frontends.html#display-browser
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I just started to explore Altair, together with Marimo. Plotting in marimo works basically, but I also wanted to try standalone scripts. However, I was completely unable to produce any output:
I tried running inside and outside of VS code.
My system is Mac OS. The script never produces any output / opens a browser fenster / writes a file.
What is missing there?
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions