Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: Collection.set_paths#26342

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
greglucas merged 1 commit intomatplotlib:mainfromrcomer:cs-set_paths
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
7 changes: 2 additions & 5 deletionslib/matplotlib/collections.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -207,7 +207,8 @@ def get_paths(self):
return self._paths

def set_paths(self, paths):
raise NotImplementedError
self._paths = paths
self.stale = True

def get_transforms(self):
return self._transforms
Expand DownExpand Up@@ -1001,10 +1002,6 @@ def __init__(self, paths, sizes=None, **kwargs):
self.set_sizes(sizes)
self.stale = True

def set_paths(self, paths):
self._paths = paths
self.stale = True

def get_paths(self):
return self._paths

Expand Down
10 changes: 9 additions & 1 deletionlib/matplotlib/tests/test_contour.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@
from matplotlib import pyplot as plt, rc_context, ticker
from matplotlib.colors import LogNorm, same_color
import matplotlib.patches as mpatches
from matplotlib.testing.decorators import image_comparison
from matplotlib.testing.decorators importcheck_figures_equal,image_comparison
import pytest


Expand DownExpand Up@@ -100,6 +100,14 @@ def test_contour_Nlevels():
assert (cs1.levels == cs2.levels).all()


@check_figures_equal(extensions=['png'])
def test_contour_set_paths(fig_test, fig_ref):
cs_test = fig_test.subplots().contour([[0, 1], [1, 2]])
cs_ref = fig_ref.subplots().contour([[1, 0], [2, 1]])

cs_test.set_paths(cs_ref.get_paths())


@pytest.mark.parametrize("split_collections", [False, True])
@image_comparison(['contour_manual_labels'], remove_text=True, style='mpl20', tol=0.26)
def test_contour_manual_labels(split_collections):
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp