我正在尝试为纸张制作轮廓图,我想在黑白中制作它,但灰度级的对比度更高。
fig = plt.figure()
ny, nx = 200, 200
ax = fig.add_subplot(1,1,1)
# Generate a regular grid to interpolate the data.
xi = np.linspace(min(x_conv), max(x_conv), nx)
yi = np.linspace(min(y_conv), max(y_conv), ny)
xi, yi = np.meshgrid(xi, yi)
x_new, xi_new = normalize_xy(x_conv), normalize_xy(xi)
y_new, yi_new = normalize_xy(y_conv), normalize_xy(yi)
zi = griddata(x_new,y_new,fwhm_conv,xi_new,yi_new)
cax=ax.pcolormesh(xi,yi,zi, cmap=cm.gray,norm=cm.colors.Normalize(vmax=5.2,vmin=3.8), extent=[min(x_conv),max(x_conv) , min(y_conv), max(y_conv)])
fontsize=15
for tick in ax.xaxis.get_major_ticks():
tick.label1.set_fontsize(fontsize)
for tick in ax.yaxis.get_major_ticks():
tick.label1.set_fontsize(fontsize)
cbar = fig.colorbar(cax,format='%0.8g')
如何增加对比度,并在黑色和白色之间使用更多不同的灰度级来说明灵敏度?