1
喜爲matplotlib情節設置軸下面我想設置軸標題,使得它們表明,X軸的值從的Python如何爲matplotlib陰謀
2**-5, 2**-4, 2**-3,..., 2**14, 2**15
和y軸值運行從
2**-15, 2**-14,...., 2**4, 2**5
圖表來看,我想顯示他們是:
爲圖中的代碼如下:
from matplotlib import pyplot
import matplotlib as mpl
import numpy as np
zvals = 100*np.random.randn(21, 21)
fig = pyplot.figure(2)
cmap2 = mpl.colors.LinearSegmentedColormap.from_list('my_colormap',
['blue','green','brown'],
256)
img2 = pyplot.imshow(zvals,interpolation='nearest',
cmap = cmap2,
origin='lower')
pyplot.colorbar(img2,cmap=cmap2)
pyplot.show()
你檢查過了嗎? (你可能需要標籤):http://matplotlib.org/examples/ticks_and_spines/ticklabels_demo_rotation.html – Adib
這裏可能有重複嗎? http://stackoverflow.com/questions/3100985/plot-with-custom-text-for-x-axis-points – Adib
我不想標記軸上的每個單元格,因爲它會看起來太多。 –