Skip to content

Small cleanups to axislines docs. #24210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 17 additions & 33 deletions lib/mpl_toolkits/axisartist/axislines.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,48 +52,35 @@

class AxisArtistHelper:
"""
AxisArtistHelper should define
following method with given APIs. Note that the first axes argument
will be axes attribute of the caller artist.::
Axis helpers should define the methods listed below. The *axes* argument
will be the axes attribute of the caller artist.

::

# LINE (spinal line?)

def get_line(self, axes):
# path : Path
return path
# Construct the spine.

def get_line_transform(self, axes):
# ...
# trans : transform
return trans
return transform

# LABEL
def get_line(self, axes):
return path

def get_label_pos(self, axes):
# x, y : position
return (x, y), trans
# Construct the label.

def get_axislabel_transform(self, axes):
return transform

def get_label_offset_transform(self,
axes,
pad_points, fontprops, renderer,
bboxes,
):
# va : vertical alignment
# ha : horizontal alignment
# a : angle
return trans, va, ha, a
def get_axislabel_pos_angle(self, axes):
return (x, y), angle

# TICK
# Construct the ticks.

def get_tick_transform(self, axes):
return trans
return transform

def get_tick_iterators(self, axes):
# iter : iterable object that yields (c, angle, l) where
# c, angle, l is position, tick angle, and label

# A pair of iterables (one for major ticks, one for minor ticks)
# that yield (tick_position, tick_angle, tick_label).
return iter_major, iter_minor
"""

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

def __init__(self, loc, nth_coord=None):
"""
nth_coord = along which coordinate value varies
in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
"""
"""``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis."""
_api.check_in_list(["left", "right", "bottom", "top"], loc=loc)
self._loc = loc

Expand Down