Closed
Description
Consider the following piece of code:
from matplotlib.figure import Figure
figure=Figure()
subplot = figure.add_subplot(111)
import matplotlib.patches as patches
p = patches.Polygon([(0,0), (1,2), (0,1), (-1,2)], fill=True, alpha=0.1)
patches.Patch.get_facecolor(p)
Out[6]: (0.0, 0.0, 1.0, 0.1)
subplot.add_patch(p)
from matplotlib.backends.backend_agg import FigureCanvasAgg
figure.set_canvas(FigureCanvasAgg(figure))
figure.savefig('a.eps')
figure.savefig('a.pdf')
The image a.eps
gets a solid fill that would be obtained if we gave alpha=1
(but alpha=0.0
gives an empty fill, as it should). And the image a.pdf
gets the correct alpha 0.1 fill.
Metadata
Metadata
Assignees
Labels
No labels