1

我正在尝试为纸张制作等高线图,我想将其制作成黑白,但灰度级对比度更高。

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')

在此处输入图像描述我怎样才能增加对比度并用黑白 之间更多不同的灰度级来说明灵敏度?

4

0 回答 0