Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour of ticks in next gen Seaborn #2908

Closed
aeturrell opened this issue Jul 14, 2022 · 1 comment · Fixed by #2915
Closed

Unexpected behaviour of ticks in next gen Seaborn #2908

aeturrell opened this issue Jul 14, 2022 · 1 comment · Fixed by #2915

Comments

@aeturrell
Copy link

Hello,

Just found a potential bug in the next gen version of seaborn.

Expected behaviour: create a histogram with y-axis limits that go from 0 to 50.
Actual behaviour: limits of y-axis do not change.
Other possible reasons for this: I may be confused between the syntax for ticks and for axes limits here, but the ticks do not appear to change either.

Reprex:

import pandas as pd
import seaborn.objects as so

diamonds = pd.read_csv(
    "https://github.com/mwaskom/seaborn-data/raw/master/diamonds.csv"
)
(
    so.Plot(diamonds, x="y")
    .add(so.Bar(), so.Hist(binwidth=0.5))
    .scale(y=so.Continuous(trans=None).tick(at=[0, 50]))
)

System info:
Python implementation: CPython
Python version : 3.9.12
IPython version : 8.3.0

Compiler : Clang 12.0.1
OS : Darwin
Release : 19.6.0
Machine : x86_64
Processor : i386
CPU cores : 4
Architecture: 64bit

seaborn : 0.12.0b1
matplotlib : 3.5.2
matplotlib_inline: 0.1.3
sys : 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:23:20)
[Clang 12.0.1 ]
pandas : 1.4.2

Thanks for all the work on this amazing package!

@mwaskom
Copy link
Owner

mwaskom commented Jul 18, 2022

Hi @aeturrell thanks so much for providing feedback on the beta! This is indeed a bug; I believe it's the same basic issue as in #2885

mwaskom added a commit that referenced this issue Jul 24, 2022
…2915)

* Make scale config apply to variables computed by the stat transform

WIP

Fixes #2908, #2885

* Don't try to scale faceting variables

* Further backcompat

* Remove unreachable line

* Consolidate _transform_coords and _setup_scales

* Improve handling of scaling edge cases

* Clean up Plot.plot by moving some logic to _setup_scales
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants