7

I would like to plot a map of the edges of the French departments, and the heat maps at the lower scale of the French IRIS. I read both shapefiles using GeoPandas.

And now

dep.plot(color="white", edgecolor='black')

enter image description here

and

iris.plot(column = 'ratio',cmap = 'Purples',ax=ax)

enter image description here

I would like to visualise the black edge colours of the departments on the IRIS plot, but when I try this

fig, ax = plt.subplots(figsize = (20,16)) 
df.plot(column = 'ratio',cmap = 'Purples',ax=ax)
dep.plot(color=None,edgecolor='k',linewidth = 4,ax=ax)

the first figure does not appear, and is hid by the second. I have tried to use alpha, to put the colour as None, but nothing seems to work.

Any help?

1
  • 3
    Can you try facecolor='none' in the second plot?
    – joris
    Commented Oct 18, 2018 at 13:25

2 Answers 2

15

You can set facecolor="none" and edgecolor="black"

import geopandas as gpd
df = gpd.read_file(r"/home/bera/Desktop/GIStest/France_etc.geojson")
ax = df.plot(column="NAME", cmap="rainbow", figsize=(20, 30))
df.plot(ax=ax, facecolor="none", edgecolor="black", linewidth=5)

enter image description here

0
2

Use facecolor='none' to plot an unfilled face. None causes default behaviour, 'none' does not fill.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.