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

BUGFIX: scatter should draw ',' as a single pixel#17367

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

Draft
brunobeltran wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
frombrunobeltran:scatter_pixel
Draft
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
5 changes: 4 additions & 1 deletionlib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4471,6 +4471,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
linewidths = rcParams['lines.linewidth']

offsets = np.ma.column_stack([x, y])
# "pixel" markers should be drawn at their "true" size
ignore_scale = marker_obj.get_marker() == ','

collection = mcoll.PathCollection(
(path,), scales,
Expand All@@ -4479,7 +4481,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
linewidths=linewidths,
offsets=offsets,
transOffset=kwargs.pop('transform', self.transData),
alpha=alpha
alpha=alpha,
ignore_scale=ignore_scale
)
collection.set_transform(mtransforms.IdentityTransform())
collection.update(kwargs)
Expand Down
11 changes: 9 additions & 2 deletionslib/matplotlib/collections.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -845,6 +845,10 @@ class _CollectionWithSizes(Collection):
"""
_factor = 1.0

def __init__(self, ignore_scale=False, **kwargs):
super().__init__(**kwargs)
self._ignore_scale = ignore_scale

def get_sizes(self):
"""
Return the sizes ('areas') of the elements in the collection.
Expand DownExpand Up@@ -874,7 +878,10 @@ def set_sizes(self, sizes, dpi=72.0):
else:
self._sizes = np.asarray(sizes)
self._transforms = np.zeros((len(self._sizes), 3, 3))
scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor
if self._ignore_scale:
scale = 1
else:
scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor
self._transforms[:, 0, 0] = scale
self._transforms[:, 1, 1] = scale
self._transforms[:, 2, 2] = 1.0
Expand All@@ -899,7 +906,7 @@ def __init__(self, paths, sizes=None, **kwargs):
%(Collection)s
"""

Collection.__init__(self,**kwargs)
super().__init__(**kwargs)
self.set_paths(paths)
self.set_sizes(sizes)
self.stale = True
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp