Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

Data Visualization with Matplotlib, Seaborn, and Pandas

5 min readJun 14, 2022

--

Grouped bar charts — Image by the author
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import numpy as np
data = {'label':['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'],
'percent':[.1, .2, .3, .4, .5, .6, .7, .8, .9, 1],
'remaining':[.9, .8, .7, .6, .5, .4, .3, .2, .1, 0],
}
df = pd.DataFrame(data)
f, (ax1, ax2, ax3) = plt.subplots(3, figsize=(12,8))# matplotlib
ax1.bar(df.label, df.percent)
# pandas
df.plot(x='label', y='percent', kind='bar', ax=ax2)

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Thiago Carvalho
Thiago Carvalho

Written by Thiago Carvalho

Data Visualization and Analytics

No responses yet