FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Include outward ticks in bounding box by mdboom · Pull Request #5683 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Handle case where there are no ticks
  • Loading branch information
mdboom committed Dec 17, 2015
commit 0a4b52e90dae60517c34ba3af09c8b43f002d950
10 changes: 8 additions & 2 deletions lib/matplotlib/axis.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1108,8 +1108,14 @@ def get_tightbbox(self, renderer):
return None

def get_tick_padding(self):
return max(self.majorTicks[0].get_tick_padding(),
self.minorTicks[0].get_tick_padding())
values = []
if len(self.majorTicks):
values.append(self.majorTicks[0].get_tick_padding())
if len(self.minorTicks):
values.append(self.minorTicks[0].get_tick_padding())
if len(values):
return max(values)
return 0.0

@allow_rasterization
def draw(self, renderer, *args, **kwargs):
Expand Down

Back | FazBrowse Home | New Git URL