Maps with Layers tutorial doesn't work
See original GitHub issueWhenever I specify ax=anything, a blank map is output.
python 3.6.4 matplotlib 2.1.2 geopandas 0.3.0
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
cities = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))
cities = cities.to_crs(world.crs)
fig, ax = plt.subplots()
# displays blank axes
ax.set_aspect('equal')
world.plot(ax=ax, color='white', edgecolor='black')
# <matplotlib.axes._subplots.AxesSubplot at 0x7fe0dd4500b8>
# <matplotlib.figure.Figure at 0x7fe0dd3f8710>
cities.plot(ax=ax, marker='o', color='red', markersize=5)
# <matplotlib.axes._subplots.AxesSubplot at 0x7fe0dd4500b8>
# <matplotlib.figure.Figure at 0x7fe104448ef0>
plt.show() # nothing
plt.savefig("test2.png") # file is a white rectangle
plotting any of these independently displays the expected output
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[ ♀️#1] HELP! My Map Doesn't Work ... - YouTube
But not just the flag of the USA, there's a world map here. And if ... ... (Managing Map Layers With HTML, CSS,...
Read more >Use map layers - Computer - My Maps Help - Google Help
Change the number of layers. Maps are created with one layer, but you can have up to 10. On your computer, sign in...
Read more >OpenLayers tutorial: map doesn't show up - GIS Stack Exchange
I'm following an OpenLayers tutorial and already there is something wrong after trying to represent a simple map.
Read more >Troubleshoot—ArcGIS Online Help | Documentation
Map Viewer Classic can't display layers in a map without a working basemap because the basemap establishes the coordinate system of the map....
Read more >Solved: Getting to Know Web GIS 5th Ed Ch4 Tutorials Incid...
I just tested searching for and adding the layers again and didn't have a problem, try deleting that map, opening a new one...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Closing this as I don’t think there is anything to do on the geopandas side. But please further comment if you still have problems with this!
@jorisvandenbossche with fig.savefig() I do manage to get the correct figure saved as a png, thank you.
but I still can’t get anything to show inline