Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/matplotlib/backends/backend_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def draw_image(self, gc, x, y, im):

ctx.save()
ctx.set_source_surface (surface, x, y)
ctx.paint()
if gc.get_alpha() != 1.0:
ctx.paint_with_alpha(gc.get_alpha())
else:
ctx.paint()
ctx.restore()

im.flipud_out()
Expand Down Expand Up @@ -465,17 +468,17 @@ def _save (self, fo, format, **kwargs):
width_in_points)

if format == 'ps':
if not cairo.HAS_PS_SURFACE:
if not hasattr(cairo, 'PSSurface'):
raise RuntimeError ('cairo has not been compiled with PS '
'support enabled')
surface = cairo.PSSurface (fo, width_in_points, height_in_points)
elif format == 'pdf':
if not cairo.HAS_PDF_SURFACE:
if not hasattr(cairo, 'PDFSurface'):
raise RuntimeError ('cairo has not been compiled with PDF '
'support enabled')
surface = cairo.PDFSurface (fo, width_in_points, height_in_points)
elif format in ('svg', 'svgz'):
if not cairo.HAS_SVG_SURFACE:
if not hasattr(cairo, 'SVGSurface'):
raise RuntimeError ('cairo has not been compiled with SVG '
'support enabled')
if format == 'svgz':
Expand Down