24 · stripes¶
series.stripes renders a 1-D series as a warming-stripes bar strip (cleopatra HistogramGlyph).
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)
Warming-stripes of a trending series.
In [2]:
Copied!
vals = np.linspace(-1, 1, 60) + rng.normal(0, 0.2, 60)
fig, ax = plt.subplots(figsize=(8, 1.6))
series.stripes(vals, ax=ax)
ax.set_title('stripes')
fig;
vals = np.linspace(-1, 1, 60) + rng.normal(0, 0.2, 60)
fig, ax = plt.subplots(figsize=(8, 1.6))
series.stripes(vals, ax=ax)
ax.set_title('stripes')
fig;