Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 255cbc8

Browse filesBrowse files
authored
Merge pull request #23318 from anntzer/unordered-spines
No need to return OrderedDict from _gen_axes_spines.
2 parents 0f6a627 + 2680aa7 commit 255cbc8
Copy full SHA for 255cbc8

File tree

Expand file treeCollapse file tree

2 files changed

+9
-13
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-13
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from collections import OrderedDict
21
from collections.abc import MutableSequence
32
from contextlib import ExitStack
43
import functools
@@ -1160,8 +1159,8 @@ def _gen_axes_spines(self, locations=None, offset=0.0, units='inches'):
11601159
-----
11611160
Intended to be overridden by new projection types.
11621161
"""
1163-
return OrderedDict((side, mspines.Spine.linear_spine(self, side))
1164-
for side in ['left', 'right', 'bottom', 'top'])
1162+
return {side: mspines.Spine.linear_spine(self, side)
1163+
for side in ['left', 'right', 'bottom', 'top']}
11651164

11661165
def sharex(self, other):
11671166
"""

‎lib/matplotlib/projections/polar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/polar.py
+7-10Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from collections import OrderedDict
21
import math
32
import types
43

@@ -12,7 +11,7 @@
1211
from matplotlib.path import Path
1312
import matplotlib.ticker as mticker
1413
import matplotlib.transforms as mtransforms
15-
import matplotlib.spines as mspines
14+
from matplotlib.spines import Spine
1615

1716

1817
class PolarTransform(mtransforms.Transform):
@@ -964,14 +963,12 @@ def _gen_axes_patch(self):
964963
return mpatches.Wedge((0.5, 0.5), 0.5, 0.0, 360.0)
965964

966965
def _gen_axes_spines(self):
967-
spines = OrderedDict([
968-
('polar', mspines.Spine.arc_spine(self, 'top',
969-
(0.5, 0.5), 0.5, 0.0, 360.0)),
970-
('start', mspines.Spine.linear_spine(self, 'left')),
971-
('end', mspines.Spine.linear_spine(self, 'right')),
972-
('inner', mspines.Spine.arc_spine(self, 'bottom',
973-
(0.5, 0.5), 0.0, 0.0, 360.0))
974-
])
966+
spines = {
967+
'polar': Spine.arc_spine(self, 'top', (0.5, 0.5), 0.5, 0, 360),
968+
'start': Spine.linear_spine(self, 'left'),
969+
'end': Spine.linear_spine(self, 'right'),
970+
'inner': Spine.arc_spine(self, 'bottom', (0.5, 0.5), 0.0, 0, 360),
971+
}
975972
spines['polar'].set_transform(self.transWedge + self.transAxes)
976973
spines['inner'].set_transform(self.transWedge + self.transAxes)
977974
spines['start'].set_transform(self._yaxis_transform)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.