Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Update plotting example to use vega_datasets module, replacing obsolete altair.load_dataset() (#579)

Daniel Jonescb6fbd893e2d
diff --git a/docs/guides/plotting.md b/docs/guides/plotting.md
index 2d41e5a958..4ff8a7e401 100644
--- a/docs/guides/plotting.md
+++ b/docs/guides/plotting.md
@@ -49,14 +49,13 @@ _Reactive plots are just one way that marimo **makes your data tangible**._
```python
import marimo as mo
import altair as alt
+import vega_datasets
# Load some data
-cars = alt.load_dataset('cars')
+cars = vega_datasets.data.cars()
# Create an Altair chart
-chart = alt.Chart(cars)
- .mark_point() # Mark type
- .encode(
+chart = alt.Chart(cars).mark_point().encode(
x='Horsepower', # Encoding along the x-axis
y='Miles_per_Gallon', # Encoding along the y-axis
color='Origin', # Category encoding by color