10000 Matplotlib does not display hatching when rendering to pdf · Issue #29 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Matplotlib does not display hatching when rendering to pdf #29
Closed
@synapticarbors

Description

@synapticarbors

I am attempting to use the hatching feature in matplotlib, which works fine when displaying to screen. However when I save the figure to pdf format, the hatch marks are not rendered:

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0,2*np.pi,100)

plt.figure()
plt.fill(x,np.sin(x),color='blue',alpha=0.5,hatch='/')
plt.show()
plt.savefig('./test.pdf',format='pdf')

I am using matplotlib 1.0.1 on OS X 10.6.6 (Specifically the Enthought Python Distribution v7).

Upon posting the issue initially to Stackoverflow, I received a workaround for the issue by using:

plt.fill(x,np.sin(x),color='blue',alpha=0.5)
plt.fill(x,np.sin(x),color='None',alpha=0.5,edgecolor='blue',hatch='/')

Not sure why this works, but it saves the pdf correctly when using the two commands in combination.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0