Skip to content

Commit dc74f43

Browse files
committed
simpler fix to matplotlib in Fourier contouring & polymask
1 parent d2e0c57 commit dc74f43

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

GSASII/GSASIIimage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,9 +1287,7 @@ def polymask(data,Poly):
12871287
ax0.fill(px,py,inmask)
12881288
ax0.set_xbound(0,Nx)
12891289
ax0.set_ybound(0,Ny)
1290-
agg = canvas.switch_backends(hcCanvas)
1291-
agg.draw()
1292-
img, (width, height) = agg.print_to_buffer()
1290+
img, (width,height) = canvas.print_to_buffer()
12931291
Zimg = np.frombuffer(img, np.uint8).reshape((height, width, 4))
12941292
return Zimg[:,:,0]
12951293

GSASII/GSASIIplot.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7430,9 +7430,7 @@ def Draw(caller='',Fade=[],NPkey=False):
74307430
contourSet = ax0.contour(ZU,colors='k',linewidths=1)
74317431
ax0.axis("off")
74327432
figure.subplots_adjust(bottom=0.,top=1.,left=0.,right=1.,wspace=0.,hspace=0.)
7433-
agg = canvas.switch_backends(hcCanvas)
7434-
agg.draw()
7435-
img, (width, height) = agg.print_to_buffer()
7433+
img, (width,height) = canvas.print_to_buffer()
74367434
Zimg = np.frombuffer(img, np.uint8).reshape((height, width, 4))
74377435
RenderViewPlane(msize*eplane,Zimg,width,height)
74387436
try:

0 commit comments

Comments
 (0)