Open
Description
Hello,
Is it possible to use brokenaxes with seaborn factoryplot ? This is my attempt of doing it, it doesn't seem to put the histogram on the broken axis.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pandas as pd
from brokenaxes import brokenaxes
a = np.array([
[0, 20],
[1, 5],
[2, 2],
[3, 1],
])
b = np.array([
[0, 10],
[1, 30],
[2, 2],
[3, 1],
])
df = pd.DataFrame({"A" : a[:, 1] , "B" : b[:, 1], "Index" : a[:, 0]})
melted = pd.melt(df, id_vars="Index", var_name="Type", value_name="Count")
melted['Index'] = melted['Index'].astype(int)
fig = plt.figure(figsize=(5, 2))
bax = brokenaxes(ylims=((0, 12), (18, 31)), hspace=.05)
ax = sns.factorplot(x='Index', y='Count', hue='Type', data=melted, kind='bar', legend=False, ax=bax)
fig.show()
Thanks!
Metadata
Metadata
Assignees
Labels
No labels