Skip to content

Instantly share code, notes, and snippets.

View AMacumber's full-sized avatar
👔
Employed as a Data Analyst at National Association of Friendship Centres

Andrew L Macumber AMacumber

👔
Employed as a Data Analyst at National Association of Friendship Centres
View GitHub Profile
@AMacumber
AMacumber / matplotlib_barplot.md
Last active May 29, 2019 14:46 — forked from ctokheim/matplotlib_barplot.md
Matplotlib: Stacked and Grouped Bar Plot

Stacked and Grouped Bar Plot

Oddly enough ggplot2 has no support for a stacked and grouped (position="dodge") bar plot. The seaborn python package, although excellent, also does not provide an alternative. However, I knew it was surely possible to make such a plot in regular matplotlib. Matplotlib, although sometimes clunky, gives you enough flexibility to precisely place plotting elements which is needed for a stacked and grouped bar plot.

Below is a working example of making a stacked and grouped bar plot.

import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-RecSys-Content-Based-movies-py-v1.ipynb
Created February 27, 2019 19:14
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-Clus-DBSCN-weather-py-v1.ipynb
Created February 27, 2019 16:31
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-Clus-Hierarchical-Cars-py-v1.ipynb
Created February 27, 2019 15:37
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-Clus-K-Means-Customer-Seg-py-v1.ipynb
Created February 27, 2019 14:26
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-Clus-K-Means-Customer-Seg-py-v1.ipynb
Created February 26, 2019 22:27
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-Clas-SVM-cancer-py-v1.ipynb
Created February 26, 2019 21:23
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AMacumber
AMacumber / ML0101EN-Clas-Logistic-Reg-churn-py-v1.ipynb
Created February 26, 2019 17:41
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.