|
・In Japanese
■Description of the pcolormesh function
Adds a grid color scheme to the graph. This is useful when you want to visualize the boundaries of a graph.
■Specific example using pcolormesh function
import numpy as np
import matplotlib.pyplot as plt
X, Y = np.mgrid[-20:20:0.1, -1:40:0.1] # Define the X and Y axes
Z = Y-0.1*X*X >0
plt.pcolormesh(X, Y, Z,alpha=0.1) # Color according to the Z value. alpha is the transmittance.
plt.show()
The results are as follows.
|
|