Skip to content

ENH: add LocalCrossPlot (Westerholt) plot and ability to scale Moran scatterplot by LOSH#446

Open
martinfleis wants to merge 9 commits intopysal:mainfrom
martinfleis:westerholt
Open

ENH: add LocalCrossPlot (Westerholt) plot and ability to scale Moran scatterplot by LOSH#446
martinfleis wants to merge 9 commits intopysal:mainfrom
martinfleis:westerholt

Conversation

@martinfleis
Copy link
Copy Markdown
Member

xref #445

@ljwolf before I craft some simple tests and figure out a way of getting a reasonable legend, can you give this a pass?

Happy to iterate on the name, @rwesterh does not like the Westerholt plot :).

@martinfleis martinfleis requested a review from ljwolf April 17, 2026 10:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.5%. Comparing base (cdb8076) to head (f6181cf).

Files with missing lines Patch % Lines
esda/inspection.py 89.7% 6 Missing ⚠️
esda/losh.py 66.7% 1 Missing ⚠️
esda/moran.py 95.8% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #446     +/-   ##
=======================================
+ Coverage   82.2%   82.5%   +0.3%     
=======================================
  Files         27      28      +1     
  Lines       3969    4051     +82     
=======================================
+ Hits        3264    3342     +78     
- Misses       705     709      +4     
Files with missing lines Coverage Δ
esda/__init__.py 100.0% <100.0%> (ø)
esda/losh.py 95.7% <66.7%> (+0.3%) ⬆️
esda/moran.py 85.2% <95.8%> (+0.3%) ⬆️
esda/inspection.py 89.7% <89.7%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@ljwolf ljwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good! I think at minimum we need to allow a significance level set by the user. I also started down the path of implementing a multiple comparisons correction, but (reflecting on it) I think that should be done at the estimator level (through the new significance calculations prompted by #281)

Comment thread esda/inspection.py Outdated
Comment thread esda/inspection.py Outdated
Comment thread esda/inspection.py Outdated
Comment thread esda/inspection.py Outdated
@ljwolf
Copy link
Copy Markdown
Member

ljwolf commented Apr 17, 2026

plot_local_cross() might be a good name–--it's a cross-statistic plot (Gi, Ii, and Hi) and it's also a cross-shape.

@rwesterh
Copy link
Copy Markdown

Thank you @ljwolf and @martinfleis for implementing the plot! The main reason I don’t like the name ‘Westerholt plot’ is that the plot does not represent a statistical measure that I developed myself. The Moran scatterplot is not called ‘Moran scatterplot’ because Pat Moran proposed the plot, but because it visualises his Moran’s I statistic. I like @ljwolf’s suggestion to call the plot a 'local cross plot'. 'Cluster heterogeneity plot' would probably also be a good name, reflecting the main purpose of the plot, namely the visualisation of different dimensions of cluster heterogeneity.

@martinfleis martinfleis changed the title ENH: add G-I-LOSH (Westerholt) plot ENH: add LocalCrossPlot (Westerholt) plot and ability to scale Moran scatterplot by LOSH Apr 23, 2026
@martinfleis
Copy link
Copy Markdown
Member Author

Cool, I have renamed the class to LocalCrossPlot and also added the ability to scale normal Moran scatterplot by LOSH as suggested by @ljwolf in #445.

@martinfleis martinfleis requested a review from ljwolf April 23, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants