2015-09-27 53 views
0

使用GeoPandas繪圖時,我掙扎着爭論。對此,我有些不明白原因,我試圖用「facecolor」,「edgecolor」,「線寬」和應該傳遞其他的參數和關鍵字matplotlib(當得到這個錯誤GeoPandas繪圖問題

TypeError: plot_dataframe() got an unexpected keyword argument 'facecolor' 

在我的理解中)。

這裏我的代碼示例

import geopandas as gpd 
import matplotlib.pyplot as plt 

my_shape=gpd.GeoDataFrame.from_file('myshape.shp') 
f = plt.figure() 
my_shape.plot(column='TYPE',colormap='cubehelix', alpha=0.5, categorical=True, legend=True, axes=f.gca(), edgecolor='w') 

我可能會做一些錯誤,但是,即使當我試圖重現這個例子:

Change single patch color in geopandas

我無法得到它的權利和仍然得到類型錯誤

感謝您的幫助

Python 2.7.10 Anaconda 2.0.1(x86_64),Matplotlib 1.4.3,GeoPandas 0.1.1(pysal 1.10.0,descartes 1.0.1)

回答

1

其他參數和關鍵字如'facecolor','edgecolor' ,'linewidth'是而不是在版本0.1.1中傳遞給matplotlib。
您可以查看docstring以查看哪些參數受支持。 在版本0.1.1中,只有colormap和alpha是支持樣式的支持關鍵字。

在當前的開發版本中也支持linewidth某些顏色關鍵字確實被傳遞給了matplotlib。

+0

感謝Joris,我的錯誤是GeoDataFrame和Pandas DataFrame混淆在我對GeoPandas的理解中。再次感謝 – egayer