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

Skip to content

Commit d3d00b2

Browse files
committed
Fix mathtext position in svg backend
svn path=/trunk/matplotlib/; revision=3346
1 parent 5b13f3b commit d3d00b2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2007-06-01 Fix mathtext position in svg backend. - NN
2+
13
2007-06-01 Deprecate Numeric and numarray for use as numerix. Props to
24
Travis -- job well done. - ADS
35

lib/matplotlib/backends/backend_svg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
271271
if angle!=0:
272272
transform = 'transform="translate(%f,%f) rotate(%1.1f) translate(%f,%f)"' % (x,y,-angle,-x,-y) # Inkscape doesn't support rotate(angle x y)
273273
else: transform = ''
274-
#newx, newy = x+ox, y-oy
275-
newx, newy = x+ox, y+oy-height
274+
if rcParams["mathtext.mathtext2"]:
275+
newx, newy = x+ox, y+oy-height
276+
else:
277+
newx, newy = x+ox, y-oy
276278
svg += """\
277279
<text style="%(style)s" x="%(newx)f" y="%(newy)f" %(transform)s>%(thetext)s</text>
278280
""" % locals()

0 commit comments

Comments
 (0)