Skip to content

Commit

Permalink
Merge pull request #5290 from pizzathief/issue5277
Browse files Browse the repository at this point in the history
implemeted get_ticks_direction()
  • Loading branch information
mdboom committed Oct 22, 2015
2 parents 5e58e90 + 84c404d commit 8379d78
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
2015-10-21 Added get_ticks_direction()

2015-02-27 Added the rcParam 'image.composite_image' to permit users
to decide whether they want the vector graphics backends to combine
all images within a set of axes into a single composite image.
Expand Down
22 changes: 22 additions & 0 deletions lib/matplotlib/axis.py
Expand Up @@ -1244,6 +1244,28 @@ def get_ticklocs(self, minor=False):
return self.minor.locator()
return self.major.locator()

def get_ticks_direction(self, minor=False):
"""
Get the tick directions as a numpy array
Parameters
----------
minor : boolean
True to return the minor tick directions,
False to return the major tick directions,
Default is False
Returns
-------
numpy array of tick directions
"""
if minor:
return np.array(
[tick._tickdir for tick in self.get_minor_ticks()])
else:
return np.array(
[tick._tickdir for tick in self.get_major_ticks()])

def _get_tick(self, major):
'return the default tick instance'
raise NotImplementedError('derived must override')
Expand Down

0 comments on commit 8379d78

Please sign in to comment.