Closed
Description
Bug summary
Custom dash sequences of the form (None, on_off_seq) seem to be rendered as solid lines in PDF exports.
Code for reproduction
import matplotlib.pyplot as plt
fig, ax = plt.subplots(num="mwe")
linestyles = ('dashed', '--', (None, (3.7, 1.6)), (0, (3.7, 1.6)))
for y, ls in enumerate(linestyles):
ax.plot([y]*2, ls=ls, label='{0}'.format(ls))
ax.set_ylim(-0.5, len(linestyles) - 0.5) # useful on mpl < 2
ax.legend()
for ext in ('.png', '.pdf'):
fig.savefig(fig.get_label() + ext)
Actual outcome
Please note that the picture above is a manual screenshot of the PDF produced with Matplotlib. For an unknown reason, GitHub does not allow me to upload the original PDF file…
Expected outcome
Something like the PNG export of the same plot:
Both PNG and PDF look fine when exported with Matplotlib 1.5.1 (from conda). PDF export seems to be “broken” in this case both with Matplotlib 2.0.0 (from conda) and and master (from GitHub).
OS: CentOS 7
Python: 2.7