I plan to use the grid and then fill it with color in the grid, but I can"t do it anyway.
how should it be implemented?
I referred to the closest example in the official matplotlib documentation, the link , but found that it was quite different
I plan to use the grid and then fill it with color in the grid, but I can"t do it anyway.
how should it be implemented?
I referred to the closest example in the official matplotlib documentation, the link , but found that it was quite different
implemented
from matplotlib import colors
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
cmap = colors.ListedColormap(['white','gray','blue','yellow'])
bounds=[0, 2, 4, 6, 8]
norm = colors.BoundaryNorm(bounds, cmap.N)
data = np.array([[1,1,1,1,7,7,7,7], [1,1,1,1,1,1,1,5], [1,1,1,1,1,1,1,5], [1,1,1,3,1,1,1,5], [1,1,1,1,1,1,3,5]])
ax = sns.heatmap(data, cmap=cmap, norm=norm, linewidths=.5, linecolor='black', square=True, cbar=False)
sns.plt.annotate('S', (1.4, 3.4))
sns.plt.show()
problem description use matplotlib to draw 3D image curve, but do not know how to fill its closed space with color. Try the fill method in 2D, but it will prompt that it cannot be used in 3D module. related codes def draw3d(yy, zz, y_f, z_f, y_l, z...
demand: if there are 1000 pieces of data and 1000 points every day for a total of 1000 days, and if you put the data of 1000 * 100days in a view, you can t see the specific performance of the data intuitively. Is there any way to achieve a similar func...
from sklearn.datasets import load_iris import matplotlib.pyplot as plt iris = load_iris() s = iris.data[iris.target == 1, 3] plt.hist(s) plt.show() s is of ndarray type. The specific data are as follows: [1.4 1.5 1.5 1.3 1.5 1.3 1.6 1. 1.3 1.4 1. 1.5...