pythonmatplotlibmapsgispysal

How to fix colors of LISA Cluster maps from Pysal


I am using the LISA Cluster package from Pysal to create a LISA (Local Indicator of Spatial Autocorrelation) map.

As the example of the documentation shows, the color lightblue is used to identify regions classified as "Low-High"

enter image description here

The problem is that, when I generate a map, that does not have a region in each of the 4 categories (HH, HL, LH, LL) the color attributed to the existent categories is changed, creating a problem to compare different maps:

enter image description here

In the Figure above, there is no regions classified as HL, so the color orange was atributed to LH, instead of lightblue.

How can I fix the colors, so LH will always be lightblue and so the others?


Solution

  • You should upgrade pysal. This was a known issue, solved in pysal 2.1.0 version.