Commit cf995d1
committed
Remove ineffective exclusion of Arcs without parent Axes.
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).1 parent 50aaa7c commit cf995d1
1 file changed
+13
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1907 | 1907 | | |
1908 | 1908 | | |
1909 | 1909 | | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
| 1910 | + | |
1917 | 1911 | | |
| 1912 | + | |
1918 | 1913 | | |
1919 | 1914 | | |
1920 | 1915 | | |
| |||
1997 | 1992 | | |
1998 | 1993 | | |
1999 | 1994 | | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
2006 | 2000 | | |
2007 | 2001 | | |
2008 | 2002 | | |
| |||
2016 | 2010 | | |
2017 | 2011 | | |
2018 | 2012 | | |
2019 | | - | |
2020 | | - | |
2021 | 2013 | | |
2022 | 2014 | | |
2023 | 2015 | | |
| |||
2104 | 2096 | | |
2105 | 2097 | | |
2106 | 2098 | | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
2111 | 2105 | | |
2112 | 2106 | | |
2113 | 2107 | | |
| |||
0 commit comments