pysal / splot

Lightweight plotting for geospatial analysis in PySAL
BSD 3-Clause "New" or "Revised" License
97 stars 27 forks source link

BUG: plot_local_autocorrelation colors do not match between subplots #178

Open olenaboiko303 opened 8 months ago

olenaboiko303 commented 8 months ago

Using plot_local_autocorrelation function here, why the color in the bottom left quadrant is not dark blue to match with the LISA cluster map?

image
martinfleis commented 8 months ago

That looks like a bug to me.

martinfleis commented 8 months ago

@olenaboiko303 I have transferred the issue to a repository where this is actually implemented at the moment. The fix will need to happen here.

Any chance you could share your data and the code you have used with us?

olenaboiko303 commented 8 months ago

@olenaboiko303 I have transferred the issue to a repository where this is actually implemented at the moment. The fix will need to happen here.

Any chance you could share your data and the code you have used with us?

@martinfleis

Thank you for addressing my question! I can't share the data, but the code is quite straightforward (see below). The second version shows that if I had values highlighted in all 4 quadrants, then the colors are no longer mismatched.

image
jGaboardi commented 8 months ago

@olenaboiko303 Can you copy & paste the code you are running? It's cumbersome to troubleshoot from an image of code.

olenaboiko303 commented 8 months ago

@jGaboardi

Please see the code snippet I'm running below.

import geopandas as gpd
from pysal.lib import weights
from esda.moran import Moran_Local
from splot.esda import plot_local_autocorrelation

mnp = gpd.read_file("./data-module-4/mnp.shp")
mnp_nbq = weights.contiguity.Queen.from_dataframe(mnp)
moran_loc = Moran_Local(mnp["PEST"], mnp_nbq)
plot_local_autocorrelation(moran_loc, mnp, 'PEST')
ugurursavas commented 5 months ago

Screenshot 2024-01-18 at 11-37-21 informal_spatial_analysis - Jupyter Notebook

ugurursavas commented 5 months ago

Hello. I encounter the same problem. I guess the yellow points in the scatter plot should be blue. It seems a bug.