Add VT2-examples: all 6 chapters of 'Visualize This' (110 files) — data scraping, ETL, trends, categorical, multivariate, spatial, distribution analysis
This commit is contained in:
1 parent
088771a9cf
commit
b42b866a8c
110 files changed
+400895
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
import pandas as pd
|
||||
|
||||
# Load data
|
||||
marjobs = pd.read_csv("data/physician-marry.tsv", delimiter="\t")
|
||||
|
||||
# Sort by most common
|
||||
marsorted = marjobs.sort_values(by=['p'], ascending=False)
|
||||
|
||||
# Set figure size and margin
|
||||
sns.set(rc={'figure.figsize':(8,8), 'pdf.fonttype': 42 })
|
||||
subs, axes = plt.subplots(1, 1)
|
||||
plt.subplots_adjust(left=.5)
|
||||
|
||||
p1 = sns.barplot(data=marsorted[0:30],
|
||||
x="p", y="occname", orient="h")
|
||||
fig = p1.get_figure()
|
||||
|
||||
# Save as PDF
|
||||
fig.savefig("bar-mar.pdf")
|
||||
|
||||
|
||||
Reference in new issue
Block a user