<jupyter_start><jupyter_text>Introduction to BasemapThe matplotlib library provides hooks for creating extensions called toolkits. To date, several have been created to compliment matplotlib, and over the course of the next few lessons, we'll be using one in particular, called Basemap, for mapping data.The Basemap matplotlib toolkit is a library for plotting 2-dimensional data onto maps. As an extension to matplotlib, Basemap does not do any of the plotting itself, but instead it provides several map projections for transforming geographic coordinates into points on a 2-dimensional cartesian plane, in other words, these projections turn longitude and latitude into x and y coordinates. Basemap was created by scientists for scientists, and as such, it can be a bit cumbersome to work with at times for the layman, but it's extremely powerful and featureful, and is likely to be the only tool you'll ever need for mapping data with matplotlib.In this lesson, we'll see how to use the Basemap library to draw a simple map of the world complete with political boundaries and lines of longitude and latitude. Before we can draw our map, however, we first need to setup our environment and choose a projection method.<!---In this lesson, we'll take our first steps with Basemap. We'll be using the toolkit to draw a simple map of the world and style it to make it aesthetically pleasing. In this lessonIn this lesson, we'll take our first steps with Basemap. We'll be using the toolkit to draw a simple map of the world, and along the way, we'll see how to do things like draw the meridians and parallels on a map, otherwise known as the longitude and latitude lines on a map. We'll see how to draw the coastlines and political borders of a map. And, how to style a map to make it aesthetically pleasing as well as informative. But, before we can do any of those things, our very first task at hand is choosing a map projection.---><jupyter_code># The current version of NumPy available from conda is issuing a warning 
# message that some behavior will change in the future when used with the 
# current version of matplotlib available from conda. This cell just keeps
# that warning from being displayed.
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)

%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt

from mpl_toolkits.basemap import Basemap
from IPython.display import set_matplotlib_formats

# Turn on retina display mode
set_matplotlib_formats('retina')

# Turn off interactive mode
plt.ioff()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.03710862002319289, 'fraction_numerical': 0.0007730962504831851, 'mean_word_length': 4.881818181818182, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '551796', 'license': 'MIT', 'n_tokens_mistral': 663, 'n_tokens_neox': 628, 'n_words': 399, 'path': 'Lesson7/MapGraph.ipynb', 'repo_name': 'wushuaibuaa/PythonDataVisualization', 'size': '2587'}