21 · quantile_band¶
series.quantile_band shades the inter-quantile band (e.g. 10–90%) across the members of an ensemble.
Setup — inline plots and the path to the bundled Lisbon DEM.
In [1]:
Copied!
%matplotlib inline
from pathlib import Path
# Locate the bundled Lisbon DEM from the repo root (works from docs/ or the repo root).
ROOT = Path.cwd()
while not (ROOT / "examples" / "data" / "LisbonElevation.tif").exists() and ROOT != ROOT.parent:
ROOT = ROOT.parent
DEM = str(ROOT / "examples" / "data" / "LisbonElevation.tif")
import numpy as np
import matplotlib.pyplot as plt
from digitalearth.static.charts import series
rng = np.random.default_rng(0)
%matplotlib inline
from pathlib import Path
# Locate the bundled Lisbon DEM from the repo root (works from docs/ or the repo root).
ROOT = Path.cwd()
while not (ROOT / "examples" / "data" / "LisbonElevation.tif").exists() and ROOT != ROOT.parent:
ROOT = ROOT.parent
DEM = str(ROOT / "examples" / "data" / "LisbonElevation.tif")
import numpy as np
import matplotlib.pyplot as plt
from digitalearth.static.charts import series
rng = np.random.default_rng(0)
Shade the 10–90% band of a 40×24 ensemble.
In [2]:
Copied!
ensemble = rng.normal(size=(40, 24)).cumsum(axis=1)
fig, ax = plt.subplots(figsize=(8, 3))
series.quantile_band(ensemble, lower=0.1, upper=0.9, ax=ax, alpha=0.3)
ax.set_title('quantile_band (10-90%)')
fig;
ensemble = rng.normal(size=(40, 24)).cumsum(axis=1)
fig, ax = plt.subplots(figsize=(8, 3))
series.quantile_band(ensemble, lower=0.1, upper=0.9, ax=ax, alpha=0.3)
ax.set_title('quantile_band (10-90%)')
fig;