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

Appearance settings

Marker sizes in Axes3D scatter plot are changing all the time #19787

Copy link
Copy link
Closed
@xlucn

Description

@xlucn
Issue body actions

Bug report

Bug summary

The marker sizes that specified with s= argument in scatter function are wrong, and even worse, the markers are changing their sizes every time the plot is re-rendered (panning or resizing). It seems that the sizes are randomly reassigned to these markers.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

fig = plt.figure()

# matplotlib 3.4
ax = Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)
# matplotlib 3.3.4
# Axes3D(fig)

x = np.random.rand(200)
y = np.random.rand(200)
z = np.random.rand(200)
ax.scatter(x, y, z, s=x*50)

plt.show()

Actual outcome

matplotlib_axes3d_marker_size_issue.mp4

Expected outcome

As shown in the screen recording, the sizes are correct and not changing. matplotlib was 3.3.4 in the following example.

matplotlib_axes3d_marker_size_expected.mp4

Matplotlib version

  • Operating system: Arch Linux
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.4.0
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.9.2
  • Jupyter version (if applicable): Not using it
  • Other libraries: numpy 1.20.1

I installed both python, numpy and matplotlib with pacman package manager from Arch's official repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.