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 b616b16

Browse filesBrowse files
committed
Update axes_grid docs
1 parent 72cad98 commit b616b16
Copy full SHA for b616b16

File tree

Expand file treeCollapse file tree

1 file changed

+64
-34
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+64
-34
lines changed

‎lib/mpl_toolkits/axes_grid1/axes_grid.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/axes_grid.py
+64-34Lines changed: 64 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ def on_changed(m):
6363
return cb
6464

6565
def _config_axes(self):
66-
'''
67-
Make an axes patch and outline.
68-
'''
66+
"""Make an axes patch and outline."""
6967
ax = self
7068
ax.set_navigate(False)
7169

@@ -142,22 +140,29 @@ def __init__(self, fig,
142140
"""
143141
Parameters
144142
----------
145-
fig : Figure
143+
fig : `.Figure`
146144
The parent figure.
147145
rect : (float, float, float, float) or int
148146
The axes position, as a ``(left, bottom, width, height)`` tuple or
149147
as a three-digit subplot position code (e.g., "121").
150-
direction : {"row", "column"}, defaults to "row"
151-
axes_pad : float or (float, float), defaults to 0.02
148+
direction : {"row", "column"}, default: "row"
149+
axes_pad : float or (float, float), default: 0.02
152150
Padding or (horizontal padding, vertical padding) between axes, in
153151
inches.
154-
add_all : bool, defaults to True
155-
share_all : bool, defaults to False
156-
share_x : bool, defaults to True
157-
share_y : bool, defaults to True
158-
label_mode : {"L", "1", "all"}, defaults to "L"
152+
add_all : bool, default: True
153+
share_all : bool, default: False
154+
share_x : bool, default: True
155+
share_y : bool, default: True
156+
label_mode : {"L", "1", "all"}, default: "L"
157+
Determines which axes will get tick labels:
158+
159+
- "L": All axes on the left column get vertical tick labels;
160+
all axes on the bottom row get horizontal tick labels.
161+
- "1": Only the bottom left axes is labelled.
162+
- "all": all axes are labelled.
163+
159164
axes_class : a type that is a subclass of `matplotlib.axes.Axes`, \
160-
defaults to None
165+
default: None
161166
"""
162167
self._nrows, self._ncols = nrows_ncols
163168

@@ -320,13 +325,19 @@ def __getitem__(self, i):
320325

321326
def get_geometry(self):
322327
"""
323-
get geometry of the grid. Returns a tuple of two integer,
324-
representing number of rows and number of columns.
328+
Return the number of rows and columns of the grid as (nrows, ncols).
325329
"""
326330
return self._nrows, self._ncols
327331

328332
def set_axes_pad(self, axes_pad):
329-
"set axes_pad"
333+
"""
334+
Set the padding between the axes.
335+
336+
Parameters
337+
----------
338+
axes_pad : (float, float)
339+
The padding (horizontal pad, vertical pad) in inches.
340+
"""
330341
self._axes_pad = axes_pad
331342

332343
# These two lines actually differ from ones in _init_axes_pad
@@ -335,25 +346,37 @@ def set_axes_pad(self, axes_pad):
335346

336347
def get_axes_pad(self):
337348
"""
338-
get axes_pad
349+
Return the axes padding.
339350
340351
Returns
341352
-------
342-
tuple
343-
Padding in inches, (horizontal pad, vertical pad)
353+
hpad, vpad
354+
Padding (horizontal pad, vertical pad) in inches.
344355
"""
345356
return self._axes_pad
346357

347358
def set_aspect(self, aspect):
348-
"set aspect"
359+
"""Set the aspect of the SubplotDivider."""
349360
self._divider.set_aspect(aspect)
350361

351362
def get_aspect(self):
352-
"get aspect"
363+
"""Return the aspect of the SubplotDivider."""
353364
return self._divider.get_aspect()
354365

355366
def set_label_mode(self, mode):
356-
"set label_mode"
367+
"""
368+
Define which axes have tick labels.
369+
370+
Parameters
371+
----------
372+
mode : {"L", "1", "all"}
373+
The label mode:
374+
375+
- "L": All axes on the left column get vertical tick labels;
376+
all axes on the bottom row get horizontal tick labels.
377+
- "1": Only the bottom left axes is labelled.
378+
- "all": all axes are labelled.
379+
"""
357380
if mode == "all":
358381
for ax in self.axes_all:
359382
_tick_only(ax, False, False)
@@ -433,28 +456,35 @@ def __init__(self, fig,
433456
"""
434457
Parameters
435458
----------
436-
fig : Figure
459+
fig : `.Figure`
437460
The parent figure.
438461
rect : (float, float, float, float) or int
439462
The axes position, as a ``(left, bottom, width, height)`` tuple or
440463
as a three-digit subplot position code (e.g., "121").
441-
direction : {"row", "column"}, defaults to "row"
442-
axes_pad : float or (float, float), defaults to 0.02
464+
direction : {"row", "column"}, default: "row"
465+
axes_pad : float or (float, float), default: 0.02
443466
Padding or (horizontal padding, vertical padding) between axes, in
444467
inches.
445-
add_all : bool, defaults to True
446-
share_all : bool, defaults to False
447-
aspect : bool, defaults to True
448-
label_mode : {"L", "1", "all"}, defaults to "L"
449-
cbar_mode : {"each", "single", "edge", None }, defaults to None
450-
cbar_location : {"left", "right", "bottom", "top"}, defaults to "right"
451-
cbar_pad : float, defaults to None
452-
cbar_size : size specification (see `.Size.from_any`), defaults to "5%"
453-
cbar_set_cax : bool, defaults to True
468+
add_all : bool, default: True
469+
share_all : bool, default: False
470+
aspect : bool, default: True
471+
label_mode : {"L", "1", "all"}, default: "L"
472+
Determines which axes will get tick labels:
473+
474+
- "L": All axes on the left column get vertical tick labels;
475+
all axes on the bottom row get horizontal tick labels.
476+
- "1": Only the bottom left axes is labelled.
477+
- "all": all axes are labelled.
478+
479+
cbar_mode : {"each", "single", "edge", None }, default: None
480+
cbar_location : {"left", "right", "bottom", "top"}, default: "right"
481+
cbar_pad : float, default: None
482+
cbar_size : size specification (see `.Size.from_any`), default: "5%"
483+
cbar_set_cax : bool, default: True
454484
If True, each axes in the grid has a *cax* attribute that is bound
455485
to associated *cbar_axes*.
456486
axes_class : a type that is a subclass of `matplotlib.axes.Axes`, \
457-
defaults to None
487+
default: None
458488
"""
459489
self._nrows, self._ncols = nrows_ncols
460490

0 commit comments

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