8000 Use ordered dict for polar spines. · matplotlib/matplotlib@734da0f · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 734da0f

Browse files
committed
Use ordered dict for polar spines.
It's not generally necessary on Cartesian plots, but can be troublesome with wedge-like polar plots where the spines can overlap at acute angles.
1 parent d67a7be commit 734da0f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import (absolute_import, division, print_function,
22
unicode_literals)
33

4+
import collections
5+
46
import numpy as np
57

68
from matplotlib.axes import Axes
@@ -644,14 +646,14 @@ def _gen_axes_patch(self):
644646
return mpatches.Wedge((0.5, 0.5), 0.5, 0.0, 360.0)
645647

646648
def _gen_axes_spines(self):
647-
spines = {'polar': mspines.Spine.arc_spine(self, 'top',
648-
(0.5, 0.5), 0.5,
649-
0.0, 360.0),
650-
'start': mspines.Spine.linear_spine(self, 'left'),
651-
'end': mspines.Spine.linear_spine(self, 'right'),
652-
'inner': mspines.Spine.arc_spine(self, 'bottom',
653-
(0.5, 0.5), 0.0,
654-
0.0, 360.0)}
649+
spines = collections.OrderedDict([
650+
('polar', mspines.Spine.arc_spine(self, 'top',
651+
(0.5, 0.5), 0.5, 0.0, 360.0)),
652+
('start', mspines.Spine.linear_spine(self, 'left')),
653+
('end', mspines.Spine.linear_spine(self, 'right')),
654+
('inner', mspines.Spine.arc_spine(self, 'bottom',
655+
(0.5, 0.5), 0.0, 0.0, 360.0))
656+
])
655657
spines['polar'].set_transform(self.transWedge + self.transAxes)
656658
spines['inner'].set_transform(self.transWedge + self.transAxes)
657659
spines['start'].set_transform(self._yaxis_transform)

0 commit comments

Comments
 (0)
0