Skip to content

Instantly share code, notes, and snippets.

@tommylees112
Last active May 21, 2021 12:55
Show Gist options
  • Save tommylees112/0dd706bf1ec016b39ac853e790d7900b to your computer and use it in GitHub Desktop.
Save tommylees112/0dd706bf1ec016b39ac853e790d7900b to your computer and use it in GitHub Desktop.
Plotting the predictions from LSTM
import xarray as xr
import matplotlib.pyplot as plt
import seaborn as sns
from pathlib import Path
data_dir = Path("C:\\Users\\anton\\Downloads")
preds = xr.open_dataset(data_dir / "preds.nc")
f, ax = plt.subplots(figsize=(12, 4))
preds.isel(pixel=0).sel(time="2007").obs.plot(ax=ax, color="k")
preds.isel(pixel=0).sel(time="2007").sim.plot(ax=ax)
ax.set_ylabel("Level")
sns.despine()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment