Skip to content

Commit

Permalink
MDAS: silence matplotlib deprecation warning (#2534)
Browse files Browse the repository at this point in the history
* MDAS: silence matplotlib deprecation warning

* Try again
  • Loading branch information
adamjstewart authored Jan 28, 2025
1 parent f828c68 commit 8acc6bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions torchgeo/datasets/mdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from collections.abc import Callable
from typing import Any, ClassVar

import matplotlib.cm as cm
import matplotlib.pyplot as plt
import numpy as np
import rasterio as rio
Expand Down Expand Up @@ -356,7 +355,7 @@ def plot(
axs[idx].imshow(img)
case 'osm_landuse_mask':
img = data.numpy().squeeze(0)
cmap = ListedColormap([cm.get_cmap('tab20')(i) for i in range(20)])
cmap = ListedColormap([plt.get_cmap('tab20')(i) for i in range(20)])
im = axs[idx].imshow(img, cmap=cmap)
cbar = plt.colorbar(im, ax=axs[idx], ticks=range(19))
cbar.ax.set_yticklabels(
Expand Down

0 comments on commit 8acc6bc

Please sign in to comment.