问题
I am running a simple example:
import gmaps
import gmaps.datasets
gmaps.configure(api_key="...")
earthquake_df = gmaps.datasets.load_dataset_as_df( 'earthquakes' )
locations = earthquake_df[[ 'latitude' , 'longitude' ]]
weights = earthquake_df[ 'magnitude' ]
fig = gmaps.figure()
fig.add_layer(gmaps.heatmap_layer(locations, weights=weights))
fig
but instead of seeing a heatmap, the output shows this:
Figure(layout=FigureLayout(height='420px'))
I am using Spyder (Python 3.7)
回答1:
(Spyder maintainer here) The reason is very simple: Spyder can't show web content on its consoles. By web content I mean content that can only be rendered in a web browser. and that's the case for the gmaps
package.
来源:https://stackoverflow.com/questions/55138615/gmaps-does-not-show-up-in-spyder