I am running this code

import geopandas
df = geopandas.read_file('test.geojson')
ax = df.plot(figsize=(10, 10), alpha=0.5, edgecolor='k')

and I get nothing besides this error

/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_gtk3.py:197: Warning: Source ID 8 was not found when attempting to remove it

The GeoJSON is okay, I tested it in QGIS. The same error turns up if I try it with other geofiles.

What am I missing?

1 Answer 1


If you import matplotlib.pyplot as plt and add plt.show() to the end of the script, the error disappears and the plot is shown.

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.