matplotlib / matplotlib/matplotlib
the size of a 3D Arrow head plotted with Axes3D.quiver
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23.2k
- Forks
- 8.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 66
Description
### Bug report
**Bug summary**
When plotting 3D arrows, there are no arguments in `Axes3D.quiver()` that can be used to changed the shape/size of the head of a 3D arrow. Nor is there any related attribute in `Line3DCollection` that can be used.
The size of a 3D arrow head seems to be dependent on the scale of the plot, i.e., `xlim`, `ylim`, and `zlim`. In the example below, a change in the scale of `z` causes the arrow head to "appear" or "disappear".
To make things easier to read, my observation of this issue will be posted in the first comment of this post.
**Code for reproduction**
```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x = np.zeros(10)
y = np.zeros(10)
z = np.arange(10)*100 # remove *100 and the arrow heads will reappear.
dx = np.zeros(10)
dy = np.arange(10)
dz = np.zeros(10)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.quiver(x, y, z, dx, dy, dz)
ax.set_ylim(0,10)
plt.show()
```
**Actual outcome**

**Expected outcome**
**_Notice the difference in the scale of z axis._**

```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x = np.zeros(10)
y = np.zeros(10)
z = np.arange(10)
dx = np.zeros(10)
dy = np.arange(10)
dz = np.zeros(10)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.quiver(x, y, z, dx, dy, dz)
ax.set_ylim(0,10)
plt.show()
```
**Matplotlib version**
* Operating system: macOS 10.13.6
* Matplotlib version: 2.2.2
* Matplotlib backend (`print(matplotlib.get_backend())`): MacOSX
* Python version: 2.7.15
* Jupyter version (if applicable): 5.6.0
* Other libraries:
matplotlib and python were installed with Anaconda.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with mpl_toolkits.mplot3d.Axes3D.quiver and the related Line3DCollection behavior, then run the supplied Python reproduction with both z scales. Done means the 3D arrow head can be controlled as requested and does not disappear merely because the plot's z scale changes; no specific test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, numpy, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100