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 62618db

Browse filesBrowse files
authored
Merge pull request #23269 from oscargus/colorbardeadcode
MNT: Remove dead code in Colorbar
2 parents 806d407 + 4e37748 commit 62618db
Copy full SHA for 62618db

File tree

Expand file treeCollapse file tree

1 file changed

+1
-27
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-27
lines changed

‎lib/matplotlib/colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+1-27Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def __init__(self, ax, mappable=None, *, cmap=None,
454454
if np.iterable(ticks):
455455
self._locator = ticker.FixedLocator(ticks, nbins=len(ticks))
456456
else:
457-
self._locator = ticks # Handle default in _ticker()
457+
self._locator = ticks
458458

459459
if isinstance(format, str):
460460
# Check format between FormatStrFormatter and StrMethodFormatter
@@ -1095,32 +1095,6 @@ def remove(self):
10951095
# use_gridspec was True
10961096
ax.set_subplotspec(subplotspec)
10971097

1098-
def _ticker(self, locator, formatter):
1099-
"""
1100-
Return the sequence of ticks (colorbar data locations),
1101-
ticklabels (strings), and the corresponding offset string.
1102-
"""
1103-
if isinstance(self.norm, colors.NoNorm) and self.boundaries is None:
1104-
intv = self._values[0], self._values[-1]
1105-
else:
1106-
intv = self.vmin, self.vmax
1107-
locator.create_dummy_axis(minpos=intv[0])
1108-
locator.axis.set_view_interval(*intv)
1109-
locator.axis.set_data_interval(*intv)
1110-
formatter.set_axis(locator.axis)
1111-
1112-
b = np.array(locator())
1113-
if isinstance(locator, ticker.LogLocator):
1114-
eps = 1e-10
1115-
b = b[(b <= intv[1] * (1 + eps)) & (b >= intv[0] * (1 - eps))]
1116-
else:
1117-
eps = (intv[1] - intv[0]) * 1e-10
1118-
b = b[(b <= intv[1] + eps) & (b >= intv[0] - eps)]
1119-
ticks = self._locate(b)
1120-
ticklabels = formatter.format_ticks(b)
1121-
offset_string = formatter.get_offset()
1122-
return ticks, ticklabels, offset_string
1123-
11241098
def _process_values(self):
11251099
"""
11261100
Set `_boundaries` and `_values` based on the self.boundaries and

0 commit comments

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