From c7503c8ea4c749ff2ba436e73e046322bcdd9a4a Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 18 Oct 2022 13:49:16 +0200 Subject: [PATCH] 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. --- lib/mpl_toolkits/axisartist/axislines.py | 50 ++++++++---------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/lib/mpl_toolkits/axisartist/axislines.py b/lib/mpl_toolkits/axisartist/axislines.py index fdbf41580f03..f63de26a55c7 100644 --- a/lib/mpl_toolkits/axisartist/axislines.py +++ b/lib/mpl_toolkits/axisartist/axislines.py @@ -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 """ @@ -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