8000 FIX: address review comments · matplotlib/matplotlib@c635fda · GitHub
[go: up one dir, main page]

Skip to content

Commit c635fda

Browse files
committed
FIX: address review comments
1 parent ab13883 commit c635fda

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

lib/matplotlib/colorbar.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,9 @@ def draw(self, renderer):
230230

231231
class _ColorbarAxesLocator:
232232
"""
233-
Wrap any locator on the axes, or its position, to shrink the
234-
inner axes if there are extend triangles at either min or max.
233+
Shrink the axes if there are vertical extends.
235234
"""
236235
def __init__(self, cbar):
237-
"""
238-
*bounds* (a ``[l, b, w, h]`` rectangle) and *transform* together
239-
specify the position of the inset axes.
240-
"""
241236
self._cbar = cbar
242237
self._orig_locator = cbar.ax._axes_locator
243238

@@ -614,10 +609,8 @@ def _do_extends(self, extendlen):
614609
"""
615610
# extend lengths are fraction of the *inner* part of colorbar,
616611
# not the total colorbar:
617-
bot = extendlen[0] if self._extend_lower() else 0
618-
bot = -bot
619-
top = extendlen[1] if self._extend_upper() else 0
620-
top = top + 1
612+
bot = 0 - (extendlen[0] if self._extend_lower() else 0)
613+
top = 1 + (extendlen[1] if self._extend_upper() else 0)
621614

622615
# xyout is the outline of the colorbar including the extend patches:
623616
if not self.extendrect:

lib/matplotlib/tests/test_colorbar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def _colorbar_extension_length(spacing):
8888
cax = fig.add_subplot(12, 1, i*3 + j + 1)
8989
# Generate the colorbar.
9090
Colorbar(cax, cmap=cmap, norm=norm,
91-
boundaries=boundaries, values=values,
92-
extend=extension_type, extendfrac=extendfrac,
93-
orientation='horizontal', spacing=spacing)
91+
boundaries=boundaries, values=values,
92+
extend=extension_type, extendfrac=extendfrac,
93+
orientation='horizontal', spacing=spacing)
9494
# Turn off text and ticks.
9595
cax.tick_params(left=False, labelleft=False,
9696
bottom=False, labelbottom=False)

0 commit comments

Comments
 (0)
0