Home > Blockchain >  x,y parameters in plot() to be treated as RGB or 2D scalar in imshow()
x,y parameters in plot() to be treated as RGB or 2D scalar in imshow()

Time:11-15

in the description of enter image description here

EDIT Calling imshow should work as well, this is how that looks like (it scales the width and height of the picture according to the dimensions of the matrix).

import numpy as np 
import matplotlib.pyplot as plt 

fig, ax = plt.subplots(constrained_layout=True)

num_series = 1000
num_points = 100

x = np.linspace(0, 4 * np.pi, num_points) 
y = np.arange(num_series)
Z = np.cumsum(np.random.randn(num_series,num_points), axis=-1)

ax.imshow(Z)

plt.show()

enter image description here

  • Related