-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
Milestone
Description
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:
Notice the missing wedge of outline at the bottom of the 9's.
Reactions are currently unavailable
