Disclaimer: This is just a notes from coursera course Data Visualization with Python
Before you start
- Import the following to use matplotlib
Basic Plotting with Matplotlib using Jupyter Notebook
Line Plots
Area Plot
Histogram and barchart
Pie Charts
Box Plots
- From top to bottom, each elements represents: outliers, maximum, third quartile, median, first quartile, min, outliers
Scatter Plots
- Plot dependent variable against independent variable
Waffle Charts
- Display progress toward goals
- The easiest way to create waffle chart is to use
pywaffle
- To implement our own waffle charts:
- get proportion of each category
- define total size of waffle
- Map proportion to number of tiles for each category
- Creating a matrix to resemble waffle chart
- Map waffle matrix to visual and prettify the tiles
- Add legends
Set parameters for waffle
Word Clouds
- need to install the package
wordcloud
Put the word Clouds on a image mask
-
Open the image to a mask
a_mask = np.array(Image.open('image.png'))
-
Create wordcloud with the mask
Seaborn and Regression Plots
Visualizing Geospatial Data - Folium
- Python library to create several types of leaflet maps
- Binding of data to a map for choropleth visualizations
- Passing visualizations as markers on the map
Create a Map
Add a marker
Choropleth Maps
- Colored map from light to dark depending on the density
- Need a geojson file:
References
- Data Visualization with Python