24 lines
527 B
Python
24 lines
527 B
Python
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")
|
|
|
|
|