Python Pylab pcolor options for publication quality plots

前端 未结 2 812
孤独总比滥情好
孤独总比滥情好 2021-02-09 18:26

I am trying to make DFT (discrete fourier transforms) plots using pcolor in python. I have previously been using Mathematica 8.0 to do this but I find that the colo

2条回答
  •  无人及你
    2021-02-09 18:37

    The following will get you closer to what you want:

    import matplotlib.pyplot as plt
    
    plt.pcolor(data, cmap=plt.cm.OrRd)
    plt.yticks(np.arange(0.5,10.5),range(0,10))
    plt.xticks(np.arange(0.5,10.5),range(0,10))
    plt.colorbar()
    plt.gca().invert_yaxis()
    plt.gca().set_aspect('equal')
    plt.show()
    

    The list of available colormaps by default is here. You'll need one that starts out white.

    enter image description here

    If none of those suits your needs, you can try generating your own, start by looking at LinearSegmentedColormap.

提交回复
热议问题