pysal.viz.splot.esda.
plot_moran_bv_simulation
(moran_bv, ax=None, fitline_kwds=None, **kwargs)[源代码]¶二元Moran's 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_BV
>>> from pysal.viz.splot.esda import plot_moran_bv_simulation
加载数据并计算权重
>>> link_to_data = examples.get_path('Guerry.shp')
>>> gdf = gpd.read_file(link_to_data)
>>> x = gdf['Suicids'].values
>>> y = gdf['Donatns'].values
>>> w = Queen.from_dataframe(gdf)
>>> w.transform = 'r'
计算二变量Moran
>>> moran_bv = Moran_BV(x, y, w)
情节
>>> plot_moran_bv_simulation(moran_bv)
>>> plt.show()
( Source code , png , hires.png , pdf )
定制图
>>> plot_moran_bv_simulation(moran_bv,
... fitline_kwds=dict(color='#4393c3'))
>>> plt.show()