One Pager Cheat Sheet
- Conveniently explore powerful data visualizations with matplotlib and plotly.
- Matplotlib can be used to graph data on
Figures
, each containing one or moreAxes
, using the Object-oriented API and NumPy arrays. - The Matplotlib figure is composed of an
Axes
object, containing multiple Axis objects which individually hold the data to be plotted. - Plotly is a
data visualization
library that helps you create interactive plots with Graph Objects and traces, while being able to render it in both HTML and Python usingipywidgets
. - Plotly creates interactive web-based plots that can be embedded into websites, apps, and Jupyter notebooks/labs using
ipywidgets
, allowing users to interact directly with the visualization. Types of plots
such asmatplotlib
andplotly
are well established for different classes of data.- We can use
matplotlib
andplotly
to generate scatter plots that represent the relationship between two continuous features. - Line plots are best to see any kind of function, by which we can easily detect trends and compare multiple functions at the same time with
matplotlib.pyplot
andplotly.express
. Bar charts
can be used to compare and visualize different kinds of categorical variables and measure the differences over time.- The
histogram
is used to graphically represent the distribution of data across a range of bins, which are created using intervals, such as in the example of plotting the age of a population. - A
Pie Chart
is a circular graph that is divided into segments or slices of pie (like a pizza) and is used to represent percentage or proportional data. - Both matplotlib and plotly can
display images
,annotate them
,show their histogram
, and many more things, and they are important components of aConvolutional Neural Network
(CNN
). imshow
is used across all three platforms (Plotly
,Matplotlib
, andOpenCV
) to display images, taking either an image or an array with an image as its argument to produce a figure.- Exploratory data visualization can be done using
matplotlib
andplotly
, and will be further explored when looking at a clustering dataset using scatter plot colors.