Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 357dad0

Browse files
authored
Merge pull request #10604 from anntzer/style
Minor style fixes.
2 parents c01f862 + cbc060c commit 357dad0

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

lib/matplotlib/artist.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,13 +1463,9 @@ def setp(obj, *args, **kwargs):
14631463
raise ValueError('The set args must be string, value pairs')
14641464

14651465
# put args into ordereddict to maintain order
1466-
funcvals = OrderedDict()
1467-
for i in range(0, len(args) - 1, 2):
1468-
funcvals[args[i]] = args[i + 1]
1469-
1470-
ret = [o.update(funcvals) for o in objs]
1471-
ret.extend([o.set(**kwargs) for o in objs])
1472-
return [x for x in cbook.flatten(ret)]
1466+
funcvals = OrderedDict((k, v) for k, v in zip(args[::2], args[1::2]))
1467+
ret = [o.update(funcvals) for o in objs] + [o.set(**kwargs) for o in objs]
1468+
return list(cbook.flatten(ret))
14731469

14741470

14751471
def kwdoc(a):

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,8 @@ def _gen_axes_spines(self, locations=None, offset=0.0, units='inches'):
988988
Intended to be overridden by new projection types.
989989
990990
"""
991-
return OrderedDict([
992-
('left', mspines.Spine.linear_spine(self, 'left')),
993-
('right', mspines.Spine.linear_spine(self, 'right')),
994-
('bottom', mspines.Spine.linear_spine(self, 'bottom')),
995-
('top', mspines.Spine.linear_spine(self, 'top'))])
991+
return OrderedDict((side, mspines.Spine.linear_spine(self, side))
992+
for side in ['left', 'right', 'bottom', 'top'])
996993

997994
def cla(self):
998995
"""Clear the current axes."""

lib/matplotlib/backends/backend_svg.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,15 +1077,13 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
10771077
('translate', (x, y)),
10781078
('rotate', (-angle,))])
10791079

1080-
# Apply attributes to 'g', not 'text', because we likely
1081-
# have some rectangles as well with the same style and
1082-
# transformation
1080+
# Apply attributes to 'g', not 'text', because we likely have some
1081+
# rectangles as well with the same style and transformation.
10831082
writer.start('g', attrib=attrib)
10841083

10851084
writer.start('text')
10861085

1087-
# Sort the characters by font, and output one tspan for
1088-
# each
1086+
# Sort the characters by font, and output one tspan for each.
10891087
spans = OrderedDict()
10901088
for font, fontsize, thetext, new_x, new_y, metrics in svg_glyphs:
10911089
style = generate_css({

0 commit comments

Comments
 (0)