0

I generate a contourplot with matplotlib.pyplot.contourf that produces a nice preview image:

enter image description here

But when I include the image into my document (using the exact same settings that I successfully employ for 1D plots) I observe some artifacts in the pdf (screenshot): enter image description here

Again, as I have no problems for 1D (scatter, line) plots, I suspect that this has something to do with contourf. Any ideas?

Dan Doe
  • 111

1 Answers1

0

Found the answer in this Stack Overflow post - it is an issue of matplotlib instead of Latex.

One needs to set the colors of the edges as

cnt = plt.contourf(x, y, z)

for c in cnt.collections: c.set_edgecolor("face")

Dan Doe
  • 111