|
From: Joshua L. <jos...@gm...> - 2012-03-19 18:35:14
|
Hi. I have attached a screenshot of the way the image looks when
viewed by Preview on my mac, evince on my RHEL5 machine, and the built
in google docs image viewer.
The image should look like 22x22 square pixels, but (at least for me)
has stripes of strange looking rectangular pixels. The preview
screenshot shows both the good and bad version of the image.
I hope this makes sense.
Joshua
On Mon, Mar 19, 2012 at 10:59 AM, Benjamin Root <ben...@ou...> wrote:
> On Sun, Mar 18, 2012 at 5:07 PM, Joshua Lande <jos...@gm...> wrote:
>>
>> Hello.
>>
>> I have run into a strange error where matplotlib compresses images
>> that are saved with the eps backend. Strangely, this compression seems
>> to happen only for images saved with certain figure sizes. I created a
>> very simple example which produces this behavior.
>>
>> import pylab as P
>> import numpy as np
>> np.random.seed(0)
>> z=np.random.uniform(size=(22,22))
>>
>> for figsize in [.5,.55]:
>> F = P.figure(None,(figsize,figsize))
>> ax = F.add_subplot(111)
>> im = ax.imshow(z, origin="lower", interpolation="nearest")
>> ax.xaxis.set_ticks([])
>> ax.yaxis.set_ticks([])
>>
>> P.savefig('test_%.2f.eps' % figsize)
>>
>> This code produces test_0.50.eps (attached) which shows ugly
>> compression whereas test_0.55.eps (also attached) is uncompressed.
>>
>> Is there an easy way to disable this compression?
>>
>> For reference, I am using python version 2.7.2, matplotlib version
>> 1.1.0, and for clarity I do not have a matplotlibrc file.
>>
>> Thanks for your help,
>>
>> Joshua
>>
>
> Using Firefox, I see no difference between the two images. What are you
> using?
>
> Ben Root
>
|