I am trying to use matplotlib and basemap to show a map of the State of Indiana and highlight a few
different counties. As a newbie I started with the code below, but I am having trouble with how to identify
and fill specific counties. Anyone have any suggestions?
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# make sure the value of resolution is a lowercase L,
# for 'low', not a numeral 1
map = Basemap(projection='merc', lat_0=39.1622, lon_0=-86.5292,
resolution = 'h', area_thresh = 0.1,
llcrnrlon=-88.53, llcrnrlat=37.16,
urcrnrlon=-84.53, urcrnrlat=41.16)
You can set the "facecolor" of the counties when you call drawcounties().
The problem is getting only certain counties colored. That means you pass a
list of colors to "facecolor". The problem there is that you don't know the
order in which the counties are processed. I've done this before, but I
have to dig up that code... Maybe someone else can beat me to that?
On Wed, Aug 19, 2015 at 11:07 AM, Tommy Grav <tgrav at me.com> wrote:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# make sure the value of resolution is a lowercase L,
# for 'low', not a numeral 1
map = Basemap(projection='merc', lat_0=39.1622, lon_0=-86.5292,
resolution = 'h', area_thresh = 0.1,
llcrnrlon=-88.53, llcrnrlat=37.16,
urcrnrlon=-84.53, urcrnrlat=41.16)