December 2018
Intermediate to advanced
318 pages
8h 28m
English
Matplotlib is a package used for plotting and graphing purposes. This helps create visualizations in 2D space. Matplotlib can be used from the Jupyter Notebook, from web application server, or from the other user interfaces.
Let's plot a small sample of the iris data that is available in the sklearn library. The data has 150 data samples and the dimensionality is 4.
We import the sklearn and matplotlib libraries in our Python environment and check the data and the features, as shown in the following code:
import matplotlib.pyplot as pltfrom sklearn import datasetsiris = datasets.load_iris()
print(iris.data.shape) # gives the data size and dimensionsprint(iris.feature_names)
The output can be seen as follows:
Read now
Unlock full access