@@ -861,7 +861,7 @@ def print_tiff(self, filename, *args, **kwargs):
861861 def print_xpm (self , filename , * args , ** kwargs ):
862862 return self ._print_image (filename , wx .BITMAP_TYPE_XPM , * args , ** kwargs )
863863
864- def _print_image (self , filename , filetype , * args , ** kwargs ):
864+ def _print_image (self , filename , filetype , * args , quality = None , ** kwargs ):
865865 origBitmap = self .bitmap
866866
867867 self .bitmap = wx .Bitmap (math .ceil (self .figure .bbox .width ),
@@ -878,11 +878,11 @@ def _print_image(self, filename, filetype, *args, **kwargs):
878878 # are saving a JPEG, convert the wx.Bitmap to a wx.Image,
879879 # and set the quality.
880880 if filetype == wx .BITMAP_TYPE_JPEG :
881- jpeg_quality = kwargs . get (
882- ' quality' ,
883- dict . __getitem__ ( mpl . rcParams , 'savefig.jpeg_quality' ) )
881+ if quality is None :
882+ quality = dict . __getitem__ ( mpl . rcParams ,
883+ 'savefig.jpeg_quality' )
884884 image = self .bitmap .ConvertToImage ()
885- image .SetOption (wx .IMAGE_OPTION_QUALITY , str (jpeg_quality ))
885+ image .SetOption (wx .IMAGE_OPTION_QUALITY , str (quality ))
886886
887887 # Now that we have rendered into the bitmap, save it to the appropriate
888888 # file type and clean up.
0 commit comments