Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated get_cmap #41

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading