Closed maddytae closed 4 months ago
import seaborn.objects as so
df = pd.DataFrame( {"x": [1, 2, 3, 4, 5], "y1": [5, 2, 1, 6, 2], "y2": [100, 240, 130, 570, 120]} ) fig, ax1 = plt.subplots(1, 1, figsize=(10, 5)) ax2 = ax1.twinx() p = so.Plot(df, x="x") p.add(so.Bar(), y="y1").on(ax1).plot() p.add(so.Line(), y="y2").on(ax2).plot()
Duplicate of https://github.com/mwaskom/seaborn/issues/3614
import seaborn.objects as so
df = pd.DataFrame( {"x": [1, 2, 3, 4, 5], "y1": [5, 2, 1, 6, 2], "y2": [100, 240, 130, 570, 120]} ) fig, ax1 = plt.subplots(1, 1, figsize=(10, 5)) ax2 = ax1.twinx() p = so.Plot(df, x="x") p.add(so.Bar(), y="y1").on(ax1).plot() p.add(so.Line(), y="y2").on(ax2).plot()