Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
mtext : `~matplotlib.text.Text`
The original text object to be rendered.
"""
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX", mtext=mtext)

def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
"""
Expand Down
12 changes: 12 additions & 0 deletions lib/matplotlib/tests/test_usetex.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ def test_usetex():
ax.set_axis_off()


def test_usetex_fallback(monkeypatch):
# Smoke test that the base draw_tex implementation works.
from matplotlib.backend_bases import RendererBase
from matplotlib.backends.backend_agg import RendererAgg
monkeypatch.setattr(RendererAgg, 'draw_tex', RendererBase.draw_tex)

plt.rcParams["text.usetex"] = True
fig, ax = plt.subplots()
ax.text(0, 0, "foo_bar")
fig.canvas.draw()


@check_figures_equal(extensions=['png', 'pdf', 'svg'])
def test_empty(fig_test, fig_ref):
mpl.rcParams['text.usetex'] = True
Expand Down
Loading