diff --git a/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.pdf b/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.pdf index 1d400a17dee9..8798f5999a71 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.pdf and b/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.pdf differ diff --git a/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.png b/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.png index 709e17dbd6c8..91d2086f85c7 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.png and b/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.svg b/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.svg index 8408f55b6790..9b646f8d5117 100644 --- a/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.svg +++ b/lib/matplotlib/tests/baseline_images/test_patheffects/patheffect3.svg @@ -5,7 +5,7 @@ @@ -31,7 +31,7 @@ z +L518.4 43.2" style="fill:none;stroke:#0000ff;stroke-linecap:square;"/> @@ -39,80 +39,286 @@ L518.4 43.2" style="fill:none;stroke:#0000ff;"/> +L0 -4" id="m93b0483c22" style="stroke:#000000;stroke-width:0.5;"/> - + +L0 4" id="m741efc42ff" style="stroke:#000000;stroke-width:0.5;"/> - + + + + + + + + + + + + + - + - + + + + + + + + + + + + - + - + + + + + + + + + + + + - + - + + + + + + + + + + + + - + - + + + + + + + + + + + + - + - + + + + + + + + + + + + @@ -123,80 +329,128 @@ L0 4" id="mdad270ee8e" style="stroke:#000000;stroke-linecap:butt;stroke-width:0. +L4 0" id="m728421d6d4" style="stroke:#000000;stroke-width:0.5;"/> - + +L-4 0" id="mcb0005524f" style="stroke:#000000;stroke-width:0.5;"/> - + + + + + + + + + - + - + + + + + + + + + - + - + + + + + + + + + - + - + + + + + + + + + - + - + + + + + + + + + - + - + + + + + + + + + @@ -224,54 +478,80 @@ L72 43.2" style="fill:none;stroke:#000000;"/> +M89.28 62.2137 +L109.44 62.2137" style="fill:none;stroke:#0000ff;stroke-linecap:square;"/> - - + + - +" id="Cmr10-32"/> + - - - - - - - + + + + + + + + diff --git a/lib/matplotlib/tests/test_patheffects.py b/lib/matplotlib/tests/test_patheffects.py index 9a5480232fd4..639c309614c7 100644 --- a/lib/matplotlib/tests/test_patheffects.py +++ b/lib/matplotlib/tests/test_patheffects.py @@ -43,12 +43,14 @@ def test_patheffect2(): path_effects=[withStroke(linewidth=3, foreground="w")]) -@image_comparison(baseline_images=['patheffect3'], remove_text=True) +@image_comparison(baseline_images=['patheffect3']) def test_patheffect3(): ax3 = plt.subplot(111) p1, = ax3.plot([0, 1], [0, 1]) - leg = ax3.legend([p1], ["Line 1"], fancybox=True, loc=2) + ax3.set_title(r'testing$^{123}$', + path_effects=[withStroke(linewidth=1, foreground="r")]) + leg = ax3.legend([p1], [r'Line 1$^2$'], fancybox=True, loc=2) leg.legendPatch.set_path_effects([withSimplePatchShadow()]) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 62fc182c5e00..ddf11901e018 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -586,7 +586,8 @@ def draw(self, renderer): self._fontproperties, angle) else: path_effect.draw_text(renderer, gc, x, y, clean_line, - self._fontproperties, angle) + self._fontproperties, angle, + ismath=ismath) else: if rcParams['text.usetex']: renderer.draw_tex(gc, x, y, clean_line,