Issue 1:
Adjacent patch objects which share an edge show a visible seam at the coincident edge for edgecolor=None. I've verified via reading the raw text in the pdf file that the points are precisely coincident and only polygons exist and there are no lines outlining the patches. The problem continues for rasterization via output to png.

To demonstrate this problem @akturner, @xylar, and myself have devised a test case script:

#!/usr/bin/python

import matplotlib as mpl
#mpl.use("tkagg")
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.transforms import Affine2D
import mpl_toolkits.axisartist.floating_axes as floating_axes

# define patches
def p1():
return patches.Rectangle(
(0.1, 0.1), # (x,y)
0.4, # width
0.8, # height
linewidth=0,
edgecolor='none'
)
def p2():
return patches.Rectangle(
(0.5, 0.1), # (x,y)
0.4, # width
0.8, # height
linewidth=0,
edgecolor='none'
)

# setup plots
fig1 = plt.figure()

# rectilinear patches in subplot 1
ax1 = fig1.add_subplot(121, aspect='equal')
ax1.add_patch(p1())
ax1.add_patch(p2())
plt.ylim([0,1])
plt.xlim([0,1])

# make rotated version of the above in subplot 2
tr = Affine2D().scale(0.5, 0.5).translate(0.6,0).rotate_deg(30)
grid_helper = floating_axes.GridHelperCurveLinear(tr, extremes=(0, 1, 0, 1))
ax2 = floating_axes.FloatingSubplot(fig1, 122, grid_helper=grid_helper)
fig1.add_subplot(ax2)
aux_ax = ax2.get_aux_axes(tr)
aux_ax.add_patch(p1())
aux_ax.add_patch(p2())
plt.ylim([0,1])
plt.xlim([0,1])

# save figures
plt.savefig('test.pdf')
plt.savefig('test.png')
plt.show()

The output for pdf shows two seams:

test.pdf

The output for png only shows a seam for the rotated rectangular patches which is why this typically does not show up for colorbars output to png:

Output to screen also has both seams:

I can understand why the problem exists for pdf, e.g., http://www.mathworks.com/matlabcentral/answers/15388-artifacts-in-figures-exported-as-pdf-from-matlab. It is obviously not desirable that this happens, however, and a solution would be greatly appreciated.

Regardless, the rasterization process in the conversion to png should remove this problem.

The issue appears to be a graphical aliasing issue because the seam disappears in pdf when smoothing is turned off. However, this is not the default for most pdf viewers.

We have noticed that this problem can be slightly alleviated by two approaches

edgecolor='face', linewidth=1 However, this distorts the shape of the polygons because colors can be mangled and make the cells appear to be different sizes, e.g., hexes are no longer hexagonal.

Scale each polygon to be slightly bigger. This solves the problem but it is inelegant and resolution dependent and not a true solution for a vector graphic because the seam will show up at some plotted scale.

Is there an alternative approach we are missing that fixes this issue? We suspect that this may be at least a soft bug warranting a warning message in matplotlib if not a solid bug.

Issue 2:
This is the underlying problem raised in #1178.

It is illustrated by the test below; note that boundary anomalies are visible in all forms--agg on the screen, and pdf and svg displayed with a viewer--but in different places depending on the viewer and the size of the figure as rendered.

Note that the colorbar is rendered using pcolormesh, which has its own renderer with agg but otherwise is handled by draw_path_collection.

import numpy as np
import matplotlib.pyplot as plt

z = np.arange(150)
z.shape = (10,15)

fig, axs = plt.subplots(2,2)

ax = axs[0,0]
cs0 = ax.contourf(z, 20)
cbar0 = fig.colorbar(cs0, ax=ax)

ax = axs[0,1]
cs1 = ax.contourf(z, 20, alpha=0.3)
cbar1 = fig.colorbar(cs1, ax=ax)

ax = axs[1,0]
im2 = ax.imshow(z, interpolation='nearest')
cbar2 = fig.colorbar(im2, ax=ax)

ax = axs[1,1]
im3 = ax.imshow(z, interpolation='nearest', alpha=0.3)
cbar3 = fig.colorbar(im3, ax=ax)

plt.savefig("test1.pdf")
plt.savefig("test1.svg")
plt.show()