Closed
Description
Bug report
Bug summary
No matplotlib.patches.Arc
is being rendering when trying to add a small segment of a circle with a large radius.
If I increase the x and y limits to include a larger section of the arc then it is rendered.
Code for reproduction
import matplotlib.pylab as pl
from matplotlib import patches
fig = pl.figure()
ax = pl.gca()
x = 212.02529006006412
y = -2115.252900600641
diameter = 4261.655587271447
a = patches.Arc((x, y), diameter, diameter, fill=False)
ax.add_patch(a)
pl.xlim(0, 20)
pl.ylim(0, 20)
fig.show()
Actual outcome
An empty figure:
Expected outcome
A figure with a small section of an arc starting a
Matplotlib version
- Operating system: Windows 10 Pro
- Matplotlib version: 3.2.1
- Matplotlib backend (
print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inline - Python version: Python 3.7.5
- Jupyter version (if applicable): Version 0.35.6
- Other libraries:
Activity
LanceJenkinZA commentedon Jun 1, 2020
The issue is with the comparison on Line L1669 of patches.py:
For this case I'm getting:
I've disabled the check and it does render correctly:
anntzer commentedon Jun 2, 2020
This bisects to #8047 (2.1). So it should be fixed but I'm not sure it's release critical.
tacaswell commentedon Jun 2, 2020
The
Arc
artists is designed to either draw the full circle and let it get clipped or to render the arc using a more accurate (and expensive) method.I also just got to this bisecting to a 2.1 change so it is not a recent regression, but it should still be fixed ASAP as this is a rather terrible bug.
tacaswell commentedon Jun 2, 2020
The fix seems to be pretty simple, we need to not do the stretching when going through the accurate path.
FIX: correctly handle large arcs
FIX: correctly handle large arcs
FIX: correctly handle large arcs
FIX: correctly handle large arcs
FIX: correctly handle large arcs
FIX: correctly handle large arcs
FIX: correctly handle large arcs
3 remaining items