# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import altair as alt
import pandas as pd

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
# -

chart.save('chart_chrome.png')

chart.save('chart_ff.png', webdriver='firefox')

import altair as alt
from vega_datasets import data
source = data.stocks()
chart = alt.Chart(source).mark_line().encode(
    x='date',
    y='price',
    color='symbol',
#    strokeDash='symbol',
).properties(background='white')
chart.save("test.png", scale_factor=2.0, webdriver='firefox')

alt.__version__



StarcoderdataJupyterScriptsDedupFiltered