pysal.viz.splot.esda.
plot_moran_simulation
(moran, ax=None, fitline_kwds=None, **kwargs)[源代码]¶全球莫兰I模拟参考分布。
参数: |
|
---|---|
返回: |
|
实例
进口
>>> import matplotlib.pyplot as plt
>>> from pysal.lib.weights.contiguity import Queen
>>> from pysal.lib import examples
>>> import geopandas as gpd
>>> from pysal.explore.esda.moran import Moran
>>> from pysal.viz.splot.esda import plot_moran_simulation
加载数据并计算权重
>>> link_to_data = examples.get_path('Guerry.shp')
>>> gdf = gpd.read_file(link_to_data)
>>> y = gdf['Donatns'].values
>>> w = Queen.from_dataframe(gdf)
>>> w.transform = 'r'
计算全局Moran
>>> moran = Moran(y, w)
情节
>>> plot_moran_simulation(moran)
>>> plt.show()
( Source code , png , hires.png , pdf )
定制图
>>> plot_moran_simulation(moran, fitline_kwds=dict(color='#4393c3'))
>>> plt.show()