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

Skip to content

Commit 4780a54

Browse files
committed
Remove some commented-out code from axes_grid.
The visibility-handling is handled by toggle(); the other changes are handled by the lines just below.
1 parent f7e7e46 commit 4780a54

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ def _extend_axes_pad(value):
2020
def _tick_only(ax, bottom_on, left_on):
2121
bottom_off = not bottom_on
2222
left_off = not left_on
23-
# [l.set_visible(bottom_off) for l in ax.get_xticklabels()]
24-
# [l.set_visible(left_off) for l in ax.get_yticklabels()]
25-
# ax.xaxis.label.set_visible(bottom_off)
26-
# ax.yaxis.label.set_visible(left_off)
2723
ax.axis["bottom"].toggle(ticklabels=bottom_off, label=bottom_off)
2824
ax.axis["left"].toggle(ticklabels=left_off, label=left_off)
2925

@@ -73,37 +69,14 @@ def _config_axes(self):
7369
"""Make an axes patch and outline."""
7470
ax = self
7571
ax.set_navigate(False)
76-
7772
ax.axis[:].toggle(all=False)
7873
b = self._default_label_on
7974
ax.axis[self.orientation].toggle(all=b)
8075

81-
# for axis in ax.axis.values():
82-
# axis.major_ticks.set_visible(False)
83-
# axis.minor_ticks.set_visible(False)
84-
# axis.major_ticklabels.set_visible(False)
85-
# axis.minor_ticklabels.set_visible(False)
86-
# axis.label.set_visible(False)
87-
88-
# axis = ax.axis[self.orientation]
89-
# axis.major_ticks.set_visible(True)
90-
# axis.minor_ticks.set_visible(True)
91-
92-
#axis.major_ticklabels.set_size(
93-
# int(axis.major_ticklabels.get_size()*.9))
94-
#axis.major_tick_pad = 3
95-
96-
# axis.major_ticklabels.set_visible(b)
97-
# axis.minor_ticklabels.set_visible(b)
98-
# axis.label.set_visible(b)
99-
10076
def toggle_label(self, b):
10177
self._default_label_on = b
10278
axis = self.axis[self.orientation]
10379
axis.toggle(ticklabels=b, label=b)
104-
#axis.major_ticklabels.set_visible(b)
105-
#axis.minor_ticklabels.set_visible(b)
106-
#axis.label.set_visible(b)
10780

10881

10982
class CbarAxes(CbarAxesBase, Axes):
@@ -618,13 +591,11 @@ def _update_locators(self):
618591
if (self._colorbar_mode == "single" and
619592
self._colorbar_location in ('left', 'bottom')):
620593
if self._colorbar_location == "left":
621-
#sz = Size.Fraction(Size.AxesX(self.axes_llc), self._nrows)
622594
sz = Size.Fraction(self._nrows, Size.AxesX(self.axes_llc))
623595
h.append(Size.from_any(self._colorbar_size, sz))
624596
h.append(Size.from_any(self._colorbar_pad, sz))
625597
locator = self._divider.new_locator(nx=0, ny=0, ny1=-1)
626598
elif self._colorbar_location == "bottom":
627-
#sz = Size.Fraction(Size.AxesY(self.axes_llc), self._ncols)
628599
sz = Size.Fraction(self._ncols, Size.AxesY(self.axes_llc))
629600
v.append(Size.from_any(self._colorbar_size, sz))
630601
v.append(Size.from_any(self._colorbar_pad, sz))
@@ -695,8 +666,6 @@ def _update_locators(self):
695666

696667
for i in range(self.ngrids):
697668
col, row = self._get_col_row(i)
698-
#locator = self._divider.new_locator(nx=4*col,
699-
# ny=2*(self._nrows - row - 1))
700669
locator = self._divider.new_locator(nx=h_ax_pos[col],
701670
ny=v_ax_pos[self._nrows-1-row])
702671
self.axes_all[i].set_axes_locator(locator)
@@ -727,13 +696,11 @@ def _update_locators(self):
727696

728697
if self._colorbar_mode == "single":
729698
if self._colorbar_location == "right":
730-
#sz = Size.Fraction(Size.AxesX(self.axes_llc), self._nrows)
731699
sz = Size.Fraction(self._nrows, Size.AxesX(self.axes_llc))
732700
h.append(Size.from_any(self._colorbar_pad, sz))
733701
h.append(Size.from_any(self._colorbar_size, sz))
734702
locator = self._divider.new_locator(nx=-2, ny=0, ny1=-1)
735703
elif self._colorbar_location == "top":
736-
#sz = Size.Fraction(Size.AxesY(self.axes_llc), self._ncols)
737704
sz = Size.Fraction(self._ncols, Size.AxesY(self.axes_llc))
738705
v.append(Size.from_any(self._colorbar_pad, sz))
739706
v.append(Size.from_any(self._colorbar_size, sz))

0 commit comments

Comments
 (0)