Skip to content

Commit

Permalink
Merge pull request #41 from BlueBrain/update-matplotlib
Browse files Browse the repository at this point in the history
remove deprecated get_cmap
  • Loading branch information
AurelienJaquier authored May 29, 2024
2 parents 29753e8 + 2d5fe03 commit 6d288a6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions currentscape/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ def get_colors(cmap, n_col):
return x.mpl_colors[:n_col], False

# is from matplotlib
new_cmap = matplotlib.cm.get_cmap(cmap, n_col)
new_cmap = matplotlib.colormaps[cmap].resampled(n_col)
# check number of colors
if matplotlib.cm.get_cmap(cmap).N < n_col:
if matplotlib.colormaps[cmap].N < n_col:
return list(new_cmap(range(n_col))), True

return list(new_cmap(range(n_col))), False
Expand Down
1 change: 1 addition & 0 deletions tests/test_currentscape_from_paper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test that example produces a figure."""

import os
import sys
from tests.utils import cwd
Expand Down
1 change: 1 addition & 0 deletions tests/test_use_case_example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test that example produces a figure."""

import os
import subprocess
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils."""

import os
from contextlib import contextmanager

Expand Down

0 comments on commit 6d288a6

Please sign in to comment.