| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The `if not hasattr(self, 'axes'): raise RuntimeError(...)` check was ineffectual, as artists now always have an Axes attribute, which can just be None for some artists. In fact, small Arcs are drawn just fine without a parent Axes; e.g. ``` from pylab import * from matplotlib.patches import * fig = figure() fig.add_artist(Ellipse((.2, .2), .1, .3, angle=45)) # for comparison fig.add_artist(Arc((.2, .2), .1, .3, angle=45, theta1=0, theta2=45)) ``` works just fine. Remove the check, and adjust the docs accordingly. On the other hand, large arcs *did* previously fail, but that occurred a bit further down, when computing `transforms.BboxTransformTo(self.axes.bbox)` (`self.axes` is None --> AttributeError). Fix that by using the figure bbox in that case (as the point is to limit the drawing to the unclipped area, which is the whole figure for Arcs without a parent Axes).
|
I am surprised this has no tests. |
Sorry, something went wrong.
|
I am pretty sure that the coverage error here is a false-negative and I believe this will be further tested by #23340 . |
Sorry, something went wrong.
|
Test failures appear to all be the font issues. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The if not hasattr(self, 'axes'): raise RuntimeError(...) check was
ineffectual, as artists now always have an Axes attribute, which can
just be None for some artists. In fact, small Arcs are drawn just fine
without a parent Axes; e.g.
works just fine. Remove the check, and adjust the docs accordingly.
On the other hand, large arcs did previously fail,
but that occurred a bit further down, when computing
transforms.BboxTransformTo(self.axes.bbox) (self.axes is None -->
AttributeError). Fix that by using the figure bbox in that case (as the
point is to limit the drawing to the unclipped area, which is the whole
figure for Arcs without a parent Axes).
PR Summary
PR Checklist
Tests and Styling
Documentation