pythoncolorbar范围_python–设置matplotlibcolorbar范围我想设置matplotlib colorbar范围。这是我到⽬前为⽌
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(20)
y = np.arange(20)
data = x[:-1,None]+y[None,:-1]
fig = f()
ax = fig.add_subplot(111)
X,Y = np.meshgrid(x,y)
quadmesh = ax.pcolormesh(X,Y,data)
#RuntimeError: You must first define an image, eg with imshow
#plt.clim(vmin=0,vmax=15)
#AttributeError: 'AxesSubplot' object has no attribute 'clim'
#ax.clim(vmin=0,vmax=15)
matplotlib中subplot
#AttributeError: 'AxesSubplot' object has no attribute 'set_clim'
#ax.set_clim(vmin=0,vmax=15)
plt.show()
如何在这⾥设置⾊标限制?

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。