Permalink
Browse files

Merge pull request #2070 from mdboom/issue2070

incorrect bbox of text
  • Loading branch information...
2 parents 33faad1 + ee3af29 commit 212a8f91306ee8af4facd56965c8246f700fd010 @mdboom mdboom committed May 29, 2013
Showing 642 changed files with 3,932 additions and 3,612 deletions.
View
@@ -230,8 +230,8 @@ so that search results are printed prettily:
'ytick.major.size': 4,
'ytick.minor.size': 2})
-Better vertical text alignment
-------------------------------
+Better vertical text alignment and multi-line text
+--------------------------------------------------
The vertical alignment of text is now consistent across backends. You
may see small differences in text placement, particularly with rotated
@@ -241,6 +241,9 @@ If you are using a custom backend, note that the `draw_text` renderer
method is now passed the location of the baseline, not the location of
the bottom of the text bounding box.
+Multi-line text will now leave enough room for the height of very tall
+or very low text, such as superscripts and subscripts.
+
``savefig.jpeg_quality`` added to rcParams
------------------------------------------------------------------------------
``rcParam`` value ``savefig.jpeg_quality`` was added so that the user can
@@ -1152,6 +1155,5 @@ Here are the 0.98.4 notes from the CHANGELOG::
arrays are now converted to arrays with NaNs for consistent
handling of masks and NaNs - MGD and EF
- Added support for arbitrary rasterization resolutions to the SVG
+ Added support for arbitrary rasterization resolutions to the SVG
backend. - MW
-
@@ -235,7 +235,7 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
w, h, d = self.get_text_width_height_descent(s, prop, ismath)
xd = d * np.sin(np.deg2rad(angle))
yd = d * np.cos(np.deg2rad(angle))
- x = np.round(x - xd)
+ x = np.round(x + xd)
y = np.round(y + yd)
self._renderer.draw_text_image(Z, x, y, angle, gc)
@@ -718,13 +718,10 @@ def get_extent(self, renderer):
_, h_, d_ = renderer.get_text_width_height_descent(
"lp", self._text._fontproperties, ismath=False)
- bbox, info = self._text._get_layout(renderer)
+ bbox, info, d = self._text._get_layout(renderer)
w, h = bbox.width, bbox.height
line = info[-1][0] # last line
- _, hh, dd = renderer.get_text_width_height_descent(
- line, self._text._fontproperties, ismath=ismath)
- d = dd # the baseline of the last line
self._baseline_transform.clear()
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 212a8f9

Please sign in to comment.