[Python] White lines in matplotlib's pcolor

Discussão em 'Python' iniciado por Stack, Março 27, 2025.

  1. Stack

    Stack Membro Participativo

    In some pdf viewers such as Preview on OSX, plots made with matplotlib's pcolor have white lines (see image below). How can I get rid of them?

    The source code is very simple (choose any data for x,y,z):

    import matplotlib
    matplotlib.use("pdf")
    import matplotlib.pyplot as pl
    pl.figure()
    pl.pcolormesh(x,y,z,cmap="Blues",linewidth=0)
    pl.savefig("heatmap.pdf")


    [​IMG]

    Continue reading...

Compartilhe esta Página