From 4c532e50971e6f73596fc3affe0ccd6de9672864 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 5 Feb 2019 14:13:01 +0100 Subject: [PATCH] Kill the unused, private _get_pixel_distance_along_axis. --- lib/matplotlib/axis.py | 62 ------------------------------------------ 1 file changed, 62 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index e33e55a2ee5a..127c9c5b0fb3 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -1914,41 +1914,6 @@ def _get_offset_text(self): self.offset_text_position = 'bottom' return offsetText - def _get_pixel_distance_along_axis(self, where, perturb): - """ - Returns the amount, in data coordinates, that a single pixel - corresponds to in the locality given by "where", which is also given - in data coordinates, and is an x coordinate. "perturb" is the amount - to perturb the pixel. Usually +0.5 or -0.5. - - Implementing this routine for an axis is optional; if present, it will - ensure that no ticks are lost due to round-off at the extreme ends of - an axis. - """ - - # Note that this routine does not work for a polar axis, because of - # the 1e-10 below. To do things correctly, we need to use rmax - # instead of 1e-10 for a polar axis. But since we do not have that - # kind of information at this point, we just don't try to pad anything - # for the theta axis of a polar plot. - if self.axes.name == 'polar': - return 0.0 - - # - # first figure out the pixel location of the "where" point. We use - # 1e-10 for the y point, so that we remain compatible with log axes. - - # transformation from data coords to display coords - trans = self.axes.transData - # transformation from display coords to data coords - transinv = trans.inverted() - pix = trans.transform_point((where, 1e-10)) - # perturb the pixel - ptp = transinv.transform_point((pix[0] + perturb, pix[1])) - dx = abs(ptp[0] - where) - - return dx - def set_label_position(self, position): """ Set the label position (top or bottom) @@ -2261,33 +2226,6 @@ def _get_offset_text(self): self.offset_text_position = 'left' return offsetText - def _get_pixel_distance_along_axis(self, where, perturb): - """ - Returns the amount, in data coordinates, that a single pixel - corresponds to in the locality given by *where*, which is also given - in data coordinates, and is a y coordinate. - - *perturb* is the amount to perturb the pixel. Usually +0.5 or -0.5. - - Implementing this routine for an axis is optional; if present, it will - ensure that no ticks are lost due to round-off at the extreme ends of - an axis. - """ - - # - # first figure out the pixel location of the "where" point. We use - # 1e-10 for the x point, so that we remain compatible with log axes. - - # transformation from data coords to display coords - trans = self.axes.transData - # transformation from display coords to data coords - transinv = trans.inverted() - pix = trans.transform_point((1e-10, where)) - # perturb the pixel - ptp = transinv.transform_point((pix[0], pix[1] + perturb)) - dy = abs(ptp[1] - where) - return dy - def set_label_position(self, position): """ Set the label position (left or right) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy