On Thu, Aug 2, 2012 at 7:21 PM, Chad Parker <parker.char...@gmail.com>wrote:
> Hello everyone-
>
> I'm a new Python/Matplotlib user, but I have quite a bit of plotting
> experience with octave/matlab and gnuplot. So, I apologize in advance if my
> python style is terrible and if I give you all the wrong information!
>
> I'm having a problem saving figures that contain images as eps files when
> my x-axis is a date/time axis. The trouble is that in the resulting eps
> file, the image data is shifted relative to the axis. I've attached two
> images as an example. In the .png file the alignment is correct and in the
> eps file it's not. The png is also nearly identical to what I get when I
> plot to the screen. The script I wrote to generate these plots is at the
> end of this message.
>
> It's worth noting that the two output images are identical if the x-axis
> is simply numerical and not a time series.
>
> I'm using python 2.7.3 and Matplotlib 1.1.0
>
> Some Google searches dug up this old thread, however, the shift that I'm
> experiencing seems to be much greater, so I don't know if it's related:
> http://old.nabble.com/Saving-as-eps-file-shifts-image--td29232680.html
>
> Can anyone help me solve this?
> Thanks in advance,
> --Chad
>
>
> Here is a minimal script that I used to generate these plots:
>
> import matplotlib.pyplot as plt
> import matplotlib.dates as dts
> from matplotlib.colors import LogNorm
>
> imgData = [[1.0/x + 1.0/y for x in range(1,100)] for y in range(1,100)]
>
> tMin=dts.epoch2num(1343947266)
> tMax=dts.epoch2num(1343947266+100)
>
> axImg=plt.subplot(111)
> axImg.imshow(imgData, norm=LogNorm(),extent=(tMin,tMax,1,100),\
> interpolation='none', origin="upper")
> axImg.xaxis_date()
> axImg.set_aspect('auto')
>
> plt.savefig("imageshift.png")
> plt.savefig("imageshift.eps")
>
>
Confirmed. This is a fairly nasty-looking result. And I am not exactly
sure what is happening here. Note that it does not matter if the png or
the eps images were saved first. It looks like an auto-scaling bug, but
given that it doesn't impact the png image, I am not so sure.
Could you file a bug report on this at the github tracker? I would like to
see this fixed before the 1.2.0 release.
Thanks!
Ben Root
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users