[Matplotlib-users] bug for savefig to eps in the latest version of matplotlib

Xu, Bin xubinrun at gmail.com
Wed Mar 29 23:16:54 EDT 2017

Dear all,

I recently update my matplotlib to the latest version, and found 
pyplot.savefig to eps file didn't work well like previous version.
Test script:
#!/usr/bin/python -tt
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import numpy as np

# normal distribution center at x=0 and y=5
x = np.random.randn(100000)
y = np.random.randn(100000) + 5

plt.hist2d(x, y, bins=40, norm=LogNorm())
The result of plt.show() is just like the result of test.png, while 
test.eps has a weired large file size (more than 20 MB in other case). 
In the meantime, the facecolor for 'NaN' value in test.eps is black, 
different from test.png and previous version. I consider it is a bug here.
How to reach the desired style (regular size, and white color for 'NaN' 
value in image)?  Thanks a lot.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 13757 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170330/39b20673/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.eps
Type: image/x-eps
Size: 947546 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170330/39b20673/attachment-0001.bin>

More information about the Matplotlib-users mailing list