X Tutup
Skip to content

Weird stroke join with patheffects #7822

@dopplershift

Description

@dopplershift

So I used the following code to draw some outlined text at large size with matplotlib 2.0.0rc2 (on macOS 10.12.2) using the Agg backend, installed from conda-forge on Python 3.5.2:

from datetime import datetime

from matplotlib import patheffects
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(6, 2), dpi=300)
ax = fig.add_axes([0.03, 0.03, 0.95, 0.95])
timestamp = datetime(1999, 5, 4, 0)
text = ax.text(0.99, 0.6, timestamp.strftime('%d %B %Y %H%MZ'),
               horizontalalignment='right', transform=ax.transAxes,
               color='white', fontsize=36, weight='bold')
text.set_path_effects([patheffects.Stroke(linewidth=6, foreground='black'),
                       patheffects.Normal()])
plt.savefig('test-stroke.png')

This gives:

image

Notice the missing wedge of outline at the bottom of the 9's.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup