Skip to content

Commit 0a9007c

Browse files
authored
Merge pull request #20961 from anntzer/mti
Small cleanups to math_to_image.
2 parents 2e31b07 + f023115 commit 0a9007c

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

lib/matplotlib/mathtext.py

-6
Original file line numberDiff line numberDiff line change
@@ -588,18 +588,12 @@ def math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None):
588588
format is determined as for `.Figure.savefig`.
589589
"""
590590
from matplotlib import figure
591-
# backend_agg supports all of the core output formats
592-
from matplotlib.backends import backend_agg
593-
594-
if prop is None:
595-
prop = FontProperties()
596591

597592
parser = MathTextParser('path')
598593
width, height, depth, _, _ = parser.parse(s, dpi=72, prop=prop)
599594

600595
fig = figure.Figure(figsize=(width / 72.0, height / 72.0))
601596
fig.text(0, depth/height, s, fontproperties=prop)
602-
backend_agg.FigureCanvasAgg(fig)
603597
fig.savefig(filename_or_obj, dpi=dpi, format=format)
604598

605599
return depth

0 commit comments

Comments
 (0)