mirror of
https://github.com/aykhans/AzSuicideDataVisualization.git
synced 2025-04-22 10:28:02 +00:00
19 lines
358 B
Python
19 lines
358 B
Python
"""
|
|
Simple Bar Chart
|
|
================
|
|
This example shows a basic bar chart created with Altair.
|
|
"""
|
|
# category: simple charts
|
|
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]
|
|
})
|
|
|
|
alt.Chart(source).mark_bar().encode(
|
|
x='a',
|
|
y='b'
|
|
)
|