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

Multivariate plotting in imshow, pcolor and pcolormesh#29221

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

Closed
trygvrad wants to merge12 commits intomatplotlib:mainfromtrygvrad:multivariate-norm
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
1ad6e44
MultiNorm class
trygvradAug 7, 2024
b00cf92
Multivariate plots for imshow, pcolor and pcolormesh
trygvradAug 7, 2024
7755c90
docstrings for multivariate plotting in imshow, pcolor and pcolormesh
trygvradJan 6, 2025
65f41c0
Additional tests for colors.MultiNorm
trygvradJan 6, 2025
5bab105
Incorporating feedback from @story645
trygvradFeb 3, 2025
63d606f
Fix for mouseover image data with a MultiNorm
trygvradFeb 5, 2025
5189e61
More feedback from @story645
trygvradFeb 8, 2025
86c46a4
updated test for im.format_cursor_data
trygvradFeb 20, 2025
e63aa3d
Apply suggestions from tacaswell
trygvradFeb 23, 2025
cbb1979
updated test image multivariate_imshow_alpha.png due to a fix for alp…
trygvradFeb 24, 2025
e1ee7dc
change call signature of colorizer._ensure_multivariate_data()
trygvradFeb 24, 2025
fa40bef
updated reference images in response to fix on main
trygvradApr 6, 2025
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
PrevPrevious commit
NextNext commit
change call signature of colorizer._ensure_multivariate_data()
changed from  colorizer._ensure_multivariate_data(n_input, A)to  colorizer._ensure_multivariate_data(A, n_input)
  • Loading branch information
@trygvrad
trygvrad committedApr 13, 2025
commite1ee7dcc73a5a3f9e8e9ca8fe9da68b653da337e
8 changes: 4 additions & 4 deletionslib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6208,8 +6208,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
# If provided, _pcolorargs will check that X, Y and C have the same shape.
# Before this check, we need to convert C from shape (K, N, M), where K is
# the number of variates, to (N, M) with a data type with K fields.
data = mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
args[-1])
data = mcolorizer._ensure_multivariate_data(args[-1],
colorizer_obj.norm.n_input)
args = (*args[:-1], data)

X, Y, C, shading = self._pcolorargs('pcolor', *args, shading=shading,
Expand DownExpand Up@@ -6465,8 +6465,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
# If provided, _pcolorargs will check that X, Y and C have the same shape.
# Before this check, we need to convert C from shape (K, N, M), where K is
# the number of variates, to (N, M) with a data type with K fields.
data = mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
args[-1])
data = mcolorizer._ensure_multivariate_data(args[-1],
colorizer_obj.norm.n_input)
args = (*args[:-1], data)

X, Y, C, shading = self._pcolorargs('pcolormesh', *args,
Expand Down
4 changes: 2 additions & 2 deletionslib/matplotlib/colorizer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -582,7 +582,7 @@ def set_array(self, A):
self._A = None
return

A = _ensure_multivariate_data(self.norm.n_input, A)
A = _ensure_multivariate_data(A,self.norm.n_input)

A = cbook.safe_masked_invalid(A, copy=True)
if not np.can_cast(A.dtype, float, "same_kind"):
Expand DownExpand Up@@ -862,7 +862,7 @@ def _ensure_cmap(cmap, accept_multivariate=False):
return cm.colormaps[cmap_name]


def _ensure_multivariate_data(n_input, data):
def _ensure_multivariate_data(data, n_input):
"""
Ensure that the data has dtype with n_input.
Input data of shape (n_input, n, m) is converted to an array of shape
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/image.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -646,7 +646,7 @@ def _normalize_image_array(A, n_input=1):
Check validity of image-like input *A* and normalize it to a format suitable for
Image subclasses.
"""
A = mcolorizer._ensure_multivariate_data(n_input, A)
A = mcolorizer._ensure_multivariate_data(A, n_input)
A = cbook.safe_masked_invalid(A, copy=True)
if n_input == 1:
if A.dtype != np.uint8 and not np.can_cast(A.dtype, float, "same_kind"):
Expand Down

[8]ページ先頭

©2009-2026 Movatter.jp