Skip to content Skip to sidebar Skip to footer

Why Does Pcolor Output A Mirrored Array In This Example?

array = np.eye(5) plt.pcolor(array) If you were to do this code, the output graph would actually be a mirror of the defined array. why is that?

Solution 1:

It just draws from the bottom left, which make quite sense if you check out the labeling on the x&y-axes. Check out documentation You can invert it though:

  1. by flipping the y-axis

    plt.gca().invert_yaxis()

  2. or by changing your input matrix (if appropriate ...)

    plt.pcolor(np.eye(5)[::-1,:])

Post a Comment for "Why Does Pcolor Output A Mirrored Array In This Example?"