Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62a22b6

Browse files
committed
mpl_toolkits.axisartist now skips ticklabels of empty string which have caused problem with some TeX installation
svn path=/trunk/matplotlib/; revision=8382
1 parent 9dd922b commit 62a22b6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

lib/matplotlib/texmanager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ def get_text_width_height_descent(self, tex, fontsize, renderer=None):
577577
"""
578578
return width, heigth and descent of the text.
579579
"""
580+
if tex.strip() == '':
581+
return 0, 0, 0
580582

581583
if renderer:
582584
dpi_fraction = renderer.points_to_pixels(1.)

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ def draw(self, renderer):
769769
#self._set_offset_radius(r)
770770

771771
for (x, y), a, l in self._locs_angles_labels:
772+
if not l.strip(): continue
772773
self._set_ref_angle(a) #+ add_angle
773774
self.set_x(x)
774775
self.set_y(y)
@@ -811,6 +812,7 @@ def get_texts_widths_heights_descents(self, renderer):
811812
"""
812813
whd_list = []
813814
for (x, y), a, l in self._locs_angles_labels:
815+
if not l.strip(): continue
814816
clean_line, ismath = self.is_math_text(l)
815817
whd = renderer.get_text_width_height_descent(
816818
clean_line, self._fontproperties, ismath=ismath)

0 commit comments

Comments
 (0)