Then we create the layout nested dictionary and Then we use
- go.Figure(data = [data],layout = layout)
To set up the object that finally gets passed into iplot()
- layout = dict(
- title = 'Global Corona stats',
- geo = dict(
- showframe = False,
- projection = {'type':'natural earth'}
- )
- )
-
- choromap = go.Figure(data = [data],layout = layout)
- iplot(choromap)
You will see the geographical map as we aimed for.
When you hover over each country, you will see data as in our text column.
Along with this, plotly has commands to hover, zoom in, zoom out, and save pictures.
From the data, only the Diamond Princess data is not shown.
The 'type' property is an enumeration that may be specified as ['equirectangular', 'mercator', 'orthographic', 'natural earth', 'kavrayskiy7', 'miller', 'robinson', 'eckert4', 'azimuthal equal area', 'azimuthal equidistant', 'conic equal area', 'conic conformal', 'conic equidistant', 'gnomonic', 'stereographic', 'mollweide', 'hammer', 'transverse mercator', 'albers usa', 'winkel tripel', 'aitoff', 'sinusoidal']
With any other data that is across the globe, you can create geographical charts. Plotly is just one of the ways, but it can be done in many other ways.