9951 explained code solutions for 126 technologies


python-matplotlibHow to use colormap


import numpy as np
import matplotlib.pyplot as plt

data = np.random.randn(30, 30)

plt.pcolormesh(data)
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

import numpy as np

load Numpy module for Python

np.random.randn(30, 30)

generate random matrix 30x30 in size

pcolormesh

create pseudo color plot

.show()

render chart in a separate window