8000 Tiny (but serious) bugfixes in image.py · matplotlib/matplotlib@6a94935 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a94935

Browse files
committed
Tiny (but serious) bugfixes in image.py
zeros -> numpy.zeros (otherwise undefined) FigureCanvasPDF -> FigureCanvasPdf (otherwise undefined) FWIW, these were both spotted with pylint. I can add a Pylint error hook to Travis-CI later on if there's interest. Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
1 parent 7326b94 commit 6a94935

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def make_image(self, magnification=1.0):
699699
if A.dtype != np.uint8:
700700
A = (255*A).astype(np.uint8)
701701
if A.shape[2] == 3:
702-
B = zeros(tuple(list(A.shape[0:2]) + [4]), np.uint8)
702+
B = np.zeros(tuple(list(A.shape[0:2]) + [4]), np.uint8)
703703
B[:,:,0:3] = A
704704
B[:,:,3] = 255
705705
A = B
@@ -1347,7 +1347,7 @@ def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
13471347
backend) will be used which will cause a figure to be raised
13481348
if :func:`~matplotlib.pyplot.show` is called. If it is False,
13491349
a pure image backend will be used depending on the extension,
1350-
'png'->FigureCanvasAgg, 'pdf'->FigureCanvasPDF,
1350+
'png'->FigureCanvasAgg, 'pdf'->FigureCanvasPdf,
13511351
'svg'->FigureCanvasSVG
13521352
13531353
@@ -1383,7 +1383,7 @@ def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
13831383
if extension=='.png':
13841384
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
13851385
elif extension=='.pdf':
1386-
from matplotlib.backends.backend_pdf import FigureCanvasPDF as FigureCanvas
1386+
from matplotlib.backends.backend_pdf import FigureCanvasPdf as FigureCanvas
13871387
elif extension=='.svg':
13881388
from matplotlib.backends.backend_svg import FigureCanvasSVG as FigureCanvas
13891389
else:

0 commit comments

Comments
 (0)
0