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 c7503c8

Browse filesBrowse files
committed
Small cleanups to axislines docs.
Note that get_label_{offset_transform,pos} only ever existed in very old versions of axisartist; get_axislabel_{transform,pos_angle} are what's been used ever since then.
1 parent bbde887 commit c7503c8
Copy full SHA for c7503c8

File tree

1 file changed

+17
-33
lines changed
Filter options

1 file changed

+17
-33
lines changed

‎lib/mpl_toolkits/axisartist/axislines.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/axislines.py
+17-33Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -52,48 +52,35 @@
5252

5353
class AxisArtistHelper:
5454
"""
55-
AxisArtistHelper should define
56-
following method with given APIs. Note that the first axes argument
57-
will be axes attribute of the caller artist.::
55+
Axis helpers should define the methods listed below. The *axes* argument
56+
will be the axes attribute of the caller artist.
5857
58+
::
5959
60-
# LINE (spinal line?)
61-
62-
def get_line(self, axes):
63-
# path : Path
64-
return path
60+
# Construct the spine.
6561
6662
def get_line_transform(self, axes):
67-
# ...
68-
# trans : transform
69-
return trans
63+
return transform
7064
71-
# LABEL
65+
def get_line(self, axes):
66+
return path
7267
73-
def get_label_pos(self, axes):
74-
# x, y : position
75-
return (x, y), trans
68+
# Construct the label.
7669
70+
def get_axislabel_transform(self, axes):
71+
return transform
7772
78-
def get_label_offset_transform(self,
79-
axes,
80-
pad_points, fontprops, renderer,
81-
bboxes,
82-
):
83-
# va : vertical alignment
84-
# ha : horizontal alignment
85-
# a : angle
86-
return trans, va, ha, a
73+
def get_axislabel_pos_angle(self, axes):
74+
return (x, y), angle
8775
88-
# TICK
76+
# Construct the ticks.
8977
9078
def get_tick_transform(self, axes):
91-
return trans
79+
return transform
9280
9381
def get_tick_iterators(self, axes):
94-
# iter : iterable object that yields (c, angle, l) where
95-
# c, angle, l is position, tick angle, and label
96-
82+
# A pair of iterables (one for major ticks, one for minor ticks)
83+
# that yield (tick_position, tick_angle, tick_label).
9784
return iter_major, iter_minor
9885
"""
9986

@@ -117,10 +104,7 @@ class Fixed(_Base):
117104
top=(0, 1))
118105

119106
def __init__(self, loc, nth_coord=None):
120-
"""
121-
nth_coord = along which coordinate value varies
122-
in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
123-
"""
107+
"""``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis."""
124108
_api.check_in_list(["left", "right", "bottom", "top"], loc=loc)
125109
self._loc = loc
126110

0 commit comments

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