Skip to content

Add PEP8-compliant aliases to transAxes, transData, etc. #11051

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions doc/users/next_whats_new/pep8-transattrs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PEP8-compliant ``axes_transform``, etc. aliases to ``transAxes``, etc.
----------------------------------------------------------------------

The ``Axes.transAxes``, ``transScale``, ``transLimits``, and ``transData``
attributes can now also be accessed under the names ``axes_transform``,
``scale_transform``, ``limits_transform``, and ``data_transform``.
32 changes: 32 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,38 @@ def _set_lim_and_transforms(self):
self._yaxis_transform = mtransforms.blended_transform_factory(
self.transAxes, self.transData)

@property
def axes_transform(self):
return self.transAxes

@axes_transform.setter
def axes_transform(self, value):
self.transAxes = value

@property
def scale_transform(self):
return self.transScale

@scale_transform.setter
def scale_transform(self, value):
self.transScale = value

@property
def limits_transform(self):
return self.transLimits

@limits_transform.setter
def limits_transform(self, value):
self.transLimits = value

@property
def data_transform(self):
return self.transData

@data_transform.setter
def data_transform(self, value):
self.transData = value

def get_xaxis_transform(self, which='grid'):
"""
Get the transformation used for drawing x-axis labels, ticks
Expand Down