-
Notifications
You must be signed in to change notification settings - Fork 8
demo altair figures
Jeremy Magland edited this page Sep 28, 2021
·
1 revision
Some text here
import altair as alt
import numpy as np
import pandas as pd
import figurl as fig
# This script is adapted from an example on the Altair website
n = 1000
x = np.arange(n) / n
source = pd.DataFrame({
'x': x,
'f(x)': np.sin(2 * np.pi * 12 * x ** 2) * x
})
# Create the Altair chart
chart = alt.Chart(source).mark_line().encode(
x='x',
y='f(x)'
)
# optionally display the chart if you are in a notebook
display(chart)
# Generate and print the figURL
url = fig.Altair(chart).url(label='Example Altair plot', channel='flatiron1')
print(url)