<h3 dir="auto">Problem</h3>
<p dir="auto">When using contourf with alpha &lt; 1, these ugly lines appear at the color boundaries. This is evident both in the contoured data as well as on the colorbar.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/45180714/85592661-5c28cb80-b614-11ea-98b5-bdd1df31abf4.png"><img src="https://user-images.githubusercontent.com/45180714/85592661-5c28cb80-b614-11ea-98b5-bdd1df31abf4.png" alt="new_look_0" style="max-width: 100%;"></a></p>
<p dir="auto">I can set antialiased=True in contourf to fix the problem with the data, but the lines on the colorbar remain.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/45180714/85592658-5c28cb80-b614-11ea-9079-a608503ae940.png"><img src="https://user-images.githubusercontent.com/45180714/85592658-5c28cb80-b614-11ea-9079-a608503ae940.png" alt="new_look" style="max-width: 100%;"></a></p>
<p dir="auto">As far as I can tell from the documentation, there doesn't seem to be a way to set antialiasing for the colorbar. Is there any way to get rid of these lines?</p>
<p dir="auto">This is the underlying problem raised in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="6572843" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/1178" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/1178/hovercard" href="https://github.com/matplotlib/matplotlib/pull/1178">#1178</a>.<br>
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.<br>
Note that the colorbar is rendered using pcolormesh, which has its own renderer with agg but otherwise is handled by draw_path_collection.</p>
<pre class="notranslate">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()
</pre>