mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.6k stars 1.93k forks source link

secondary y axis is messing up the y-axis labels #3739

Closed maddytae closed 4 months ago

maddytae commented 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()

Screenshot 2024-07-25 at 8 39 11 AM
mwaskom commented 4 months ago

Duplicate of https://github.com/mwaskom/seaborn/issues/3614