Seams in a grid of images

Hi,

I’m trying to plot a grid of images with no spaces in between them and I have problems with the snapping. The grid is computed in data coordinates and the positions of the images are determined by the extents parameter

ax.imshow(read_png(filename), extent=extent, snap=True)

The images and extents are always the same size and each image starts where the last finished

(x0, x0+dx, y0, y0+dy)

(x0+dx, x0+2*dx, y0, y0+dy)

etc…

but it seems something happens in the backend (both QT4 and GTKAgg) and pixel seams are visible between the images at various zoom levels.

It seems the ImageGrid was developed to fix this kind of problem, but I’m not sure I can adapt my plot to use ImageGrid. I want to draw stuff over my images and I need to position them in data coordinates.

I’ve tried the snap=True parameter to imshow and it doesn’t seem to affect the output.

Does anyone have a simple solution to this problem which eliminates the seams?

thanks,

Could you try out the latest version of matplotlib from the master branch? There have been some work in this area in the past few months. I don’t know if any of that work went into the recently announced v1.1.1-rc2.

Ben Root

···

On Thu, Jun 14, 2012 at 11:08 AM, tcb <thecolourblue+m@…149…> wrote:

Hi,

I’m trying to plot a grid of images with no spaces in between them and I have problems with the snapping. The grid is computed in data coordinates and the positions of the images are determined by the extents parameter

ax.imshow(read_png(filename), extent=extent, snap=True)

The images and extents are always the same size and each image starts where the last finished

(x0, x0+dx, y0, y0+dy)

(x0+dx, x0+2*dx, y0, y0+dy)

etc…

but it seems something happens in the backend (both QT4 and GTKAgg) and pixel seams are visible between the images at various zoom levels.

It seems the ImageGrid was developed to fix this kind of problem, but I’m not sure I can adapt my plot to use ImageGrid. I want to draw stuff over my images and I need to position them in data coordinates.

I’ve tried the snap=True parameter to imshow and it doesn’t seem to affect the output.

Does anyone have a simple solution to this problem which eliminates the seams?

thanks,

hi,

I’m using the latest version from git.

Any idea what patches are part of that work? or even which classes/functions were touched?

thanks,

···

On Thu, Jun 14, 2012 at 4:12 PM, Benjamin Root <ben.root@…553…> wrote:

On Thu, Jun 14, 2012 at 11:08 AM, tcb <thecolourblue+m@…149…> wrote:

Hi,

I’m trying to plot a grid of images with no spaces in between them and I have problems with the snapping. The grid is computed in data coordinates and the positions of the images are determined by the extents parameter

ax.imshow(read_png(filename), extent=extent, snap=True)

The images and extents are always the same size and each image starts where the last finished

(x0, x0+dx, y0, y0+dy)

(x0+dx, x0+2*dx, y0, y0+dy)

etc…

but it seems something happens in the backend (both QT4 and GTKAgg) and pixel seams are visible between the images at various zoom levels.

It seems the ImageGrid was developed to fix this kind of problem, but I’m not sure I can adapt my plot to use ImageGrid. I want to draw stuff over my images and I need to position them in data coordinates.

I’ve tried the snap=True parameter to imshow and it doesn’t seem to affect the output.

Does anyone have a simple solution to this problem which eliminates the seams?

thanks,

Could you try out the latest version of matplotlib from the master branch? There have been some work in this area in the past few months. I don’t know if any of that work went into the recently announced v1.1.1-rc2.

Ben Root