Understanding map projections
We used an example of one projection type in our map, and now we'll explore this topic in more detail. When we try to draw the Earth (or part of it) on a flat rectangle, the shape is inevitably distorted somehow. So, there are different ways, or projections, available that can be used. No projection is perfect, and there are trade-offs between accuracy in shape, area, relative position, and so on. The details of which projection is more appropriate depends on the application and is beyond the scope of this book. We will, however, explore how to change the projection being used and see how to get the available projections.
With Plotly Express, we have a projection
parameter in the map functions, which takes a string and can be used to set the desired projection type. Alternatively, we can also set it by assigning a value to fig.layout.geo.projection.type
as we did previously.
Figure 7.9 shows a few of the available options together with their...