我想在Python中使用cubehelix
但是我一直在想我應該顯示的簡單問題。我正在使用的代碼如下:'module'對象在cubehelix中沒有屬性'cmap'python
import matplotlib.pyplot as plt import numpy as np import cubehelix
cx1 = cubehelix.cmap(reverse=True) alplot = plt.imshow(rtotal_rotated,vmax=1100,extent[-21,19,23,-17],cmap=cx1)
但是下面的錯誤出現,當我運行代碼:
AttributeError: 'module' object has no attribute 'cmap'
我知道這」沒錯,因爲我只是遵循本教程的代碼 http://www.ifweassume.com/2014/04/cubehelix-colormap-for-python.html
所以我不確定它爲什麼突破。
這似乎並不奏效。當我重命名文件並改變我的文件中的所有內容時,它仍然不起作用 – Nat