Closed
Description
Bug summary
When creating a 3D plot using add_collection3d
, the view limits are not automatically updated like in other plot functions.
Possibly related to #14298.
Code for reproduction
import matplotlib.pyplot as plt
import matplotlib.collections
import numpy as np
fig, ax = plt.subplots(1, 1, figsize=(7, 4), constrained_layout=True, subplot_kw=dict(projection='3d', proj_type='ortho'))
xy = np.array([[(0, 0), (0.5, 100), (1, 0)]])
ax.add_collection3d(matplotlib.collections.LineCollection(xy))
# Manually update view limits
# ax.auto_scale_xyz(xy[..., 0], xy[..., 1], None, ax.has_data())
plt.show()
Actual outcome
Expected outcome
Produced by uncommenting the line of code below # Manually update view limits
.
Additional information
I'm using matplotlib 3.5.0, but the relevant code does not seem to call auto_scale_xyz
like the other plot functions in the 3.5.2 branch or the main branch.
Operating system
Window 10
Matplotlib Version
3.5.0
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.9.9
Jupyter version
3.4.3
Installation
pip