Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87ba9cb

Browse files
committed
Updated CHANGELOG to put proposed change at the top of the list
Reverted from the 'combine_images' terminology back to the 'composite_image' terminology. With this terminology, we can keep the method name 'renderer.option_image_nocomposite()', and maintain backwards compatibility.
1 parent b92ba6b commit 87ba9cb

22 files changed

Lines changed: 63 additions & 65 deletions

CHANGELOG

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1+
2015-02-27 Added the rcParam 'image.composite_image' to permit users
2+
to decide whether they want the vector graphics backends to combine
3+
all images within a set of axes into a single composite image.
4+
(If images do not get combined, users can open vector graphics files
5+
in Adobe Illustrator or Inkscape and edit each image individually.)
6+
17
2015-02-19 Rewrite of C++ code that calculates contours to add support for
28
corner masking. This is controlled by the 'corner_mask' keyword
39
in plotting commands 'contour' and 'contourf'. - IMT
410

5-
2015-01-31 Added the rcParam 'image.combine_images' to permit users
6-
to decide whether they want the vector graphics backends to combine
7-
all images within a set of axes into a single image. (If images do
8-
not get combined, users can open vector graphics files in Adobe
9-
Illustrator or Inkscape and edit each image individually.) Also
10-
changed 'renderer.option_nocomposite' to the clearer name
11-
'renderer.option_combine_images'.
12-
1311
2015-01-23 Text bounding boxes are now computed with advance width rather than
1412
ink area. This may result in slightly different placement of text.
1513

lib/matplotlib/axes/_base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,13 +2028,13 @@ def draw(self, renderer=None, inframe=False):
20282028
dsu = [(a.zorder, a) for a in artists
20292029
if not a.get_animated()]
20302030

2031-
# add images to dsu if the backend supports combining images.
2032-
# otherwise, perform manual combining, without adding images to dsu.
2033-
if len(self.images) <= 1 or not renderer.option_combine_images():
2031+
# add images to dsu if the backend supports compositing.
2032+
# otherwise, does the manual compositing without adding images to dsu.
2033+
if len(self.images) <= 1 or renderer.option_image_nocomposite():
20342034
dsu.extend([(im.zorder, im) for im in self.images])
2035-
_combine_images = False
2035+
_do_composite = False
20362036
else:
2037-
_combine_images = True
2037+
_do_composite = True
20382038

20392039
dsu.sort(key=itemgetter(0))
20402040

@@ -2054,8 +2054,8 @@ def draw(self, renderer=None, inframe=False):
20542054
if self.axison and self._frameon:
20552055
self.patch.draw(renderer)
20562056

2057-
if _combine_images:
2058-
# combine images, blending alpha
2057+
if _do_composite:
2058+
# make a composite image, blending alpha
20592059
# list of (mimage.Image, ox, oy)
20602060

20612061
zorder_images = [(im.zorder, im) for im in self.images

lib/matplotlib/backend_bases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,12 @@ def draw_image(self, gc, x, y, im):
527527
"""
528528
raise NotImplementedError
529529

530-
def option_combine_images(self):
530+
def option_image_nocomposite(self):
531531
"""
532-
override this method for renderers that do not necessarily
532+
override this method for renderers that do not necessarily always
533533
want to rescale and composite raster images. (like SVG, PDF, or PS)
534534
"""
535-
return True
535+
return False
536536

537537
def option_scale_image(self):
538538
"""

lib/matplotlib/backends/backend_agg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ def buffer_rgba(self):
322322
def clear(self):
323323
self._renderer.clear()
324324

325-
def option_combine_images(self):
326-
# It is generally faster to write each image directly to
327-
# the Figure, and there's no file size benefit to combining images
325+
def option_image_nocomposite(self):
326+
# It is generally faster to composite each image directly to
327+
# the Figure, and there's no file size benefit to compositing
328328
# with the Agg backend
329-
return False
329+
return True
330330

331331
def option_scale_image(self):
332332
"""

lib/matplotlib/backends/backend_macosx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ def flipy(self):
170170
def points_to_pixels(self, points):
171171
return points/72.0 * self.dpi
172172

173-
def option_combine_images(self):
174-
return False
173+
def option_image_nocomposite(self):
174+
return True
175175

176176

177177
class GraphicsContextMac(_macosx.GraphicsContext, GraphicsContextBase):

lib/matplotlib/backends/backend_mixed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self, figure, width, height, dpi, vector_renderer,
6363
draw_path_collection draw_quad_mesh draw_tex draw_text
6464
finalize flipy get_canvas_width_height get_image_magnification
6565
get_texmanager get_text_width_height_descent new_gc open_group
66-
option_combine_images points_to_pixels strip_math
66+
option_image_nocomposite points_to_pixels strip_math
6767
start_filter stop_filter draw_gouraud_triangle
6868
draw_gouraud_triangles option_scale_image
6969
_text2path _get_text_path_transform height width

lib/matplotlib/backends/backend_pdf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,12 +1577,12 @@ def option_scale_image(self):
15771577
"""
15781578
return True
15791579

1580-
def option_combine_images(self):
1580+
def option_image_nocomposite(self):
15811581
"""
1582-
return whether to combine multiple images on a set of axes into one
1583-
image
1582+
return whether to generate a composite image from multiple images on
1583+
a set of axes
15841584
"""
1585-
return rcParams['image.combine_images']
1585+
return not rcParams['image.composite_image']
15861586

15871587
def draw_image(self, gc, x, y, im, dx=None, dy=None, transform=None):
15881588
self.check_gc(gc)

lib/matplotlib/backends/backend_ps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,12 @@ def option_scale_image(self):
452452
"""
453453
return True
454454

455-
def option_combine_images(self):
455+
def option_image_nocomposite(self):
456456
"""
457-
return whether to combine multiple images on a set of axes into one
458-
image
457+
return whether to generate a composite image from multiple images on
458+
a set of axes
459459
"""
460-
return rcParams['image.combine_images']
460+
return not rcParams['image.composite_image']
461461

462462
def _get_image_h_w_bits_command(self, im):
463463
if im.is_grayscale:

lib/matplotlib/backends/backend_svg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,15 +527,15 @@ def open_group(self, s, gid=None):
527527
def close_group(self, s):
528528
self.writer.end('g')
529529

530-
def option_combine_images(self):
530+
def option_image_nocomposite(self):
531531
"""
532-
if svg.image_noscale is True, combining multiple images into one is
533-
prohibited
532+
return whether to generate a composite image from multiple images on
533+
a set of axes
534534
"""
535535
if rcParams['svg.image_noscale']:
536-
return False
536+
return True
537537
else:
538-
return rcParams['image.combine_images']
538+
return not rcParams['image.composite_image']
539539

540540
def _convert_path(self, path, transform=None, clip=None, simplify=None):
541541
if clip:

lib/matplotlib/figure.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,16 +1045,16 @@ def draw(self, renderer):
10451045

10461046
# override the renderer default if self.suppressComposite
10471047
# is not None
1048-
combine_images = renderer.option_combine_images()
1048+
not_composite = renderer.option_image_nocomposite()
10491049
if self.suppressComposite is not None:
1050-
combine_images = not self.suppressComposite
1050+
not_composite = self.suppressComposite
10511051

1052-
if (len(self.images) <= 1 or not combine_images or
1052+
if (len(self.images) <= 1 or not_composite or
10531053
not cbook.allequal([im.origin for im in self.images])):
10541054
for a in self.images:
10551055
dsu.append((a.get_zorder(), a, a.draw, [renderer]))
10561056
else:
1057-
# make a combined image, blending alpha
1057+
# make a composite image blending alpha
10581058
# list of (_image.Image, ox, oy)
10591059
mag = renderer.get_image_magnification()
10601060
ims = [(im.make_image(mag), im.ox, im.oy, im.get_alpha())
@@ -1067,15 +1067,15 @@ def draw(self, renderer):
10671067
im.is_grayscale = False
10681068
l, b, w, h = self.bbox.bounds
10691069

1070-
def draw_combined_image():
1070+
def draw_composite():
10711071
gc = renderer.new_gc()
10721072
gc.set_clip_rectangle(self.bbox)
10731073
gc.set_clip_path(self.get_clip_path())
10741074
renderer.draw_image(gc, l, b, im)
10751075
gc.restore()
10761076

10771077
dsu.append((self.images[0].get_zorder(), self.images[0],
1078-
draw_combined_image, []))
1078+
draw_composite, []))
10791079

10801080
# render the axes
10811081
for a in self.axes:

0 commit comments

Comments
 (0)