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

Add Plot.limit method #2898

Merged
merged 2 commits into from
Jul 12, 2022
Merged

Add Plot.limit method #2898

merged 2 commits into from
Jul 12, 2022

Conversation

mwaskom
Copy link
Owner

@mwaskom mwaskom commented Jul 12, 2022

I still feel slightly non-committal about this having its own distinct method, but I think this is probably the most straightforward approach.

This has the nice feature of accepting and converting various units, including on a Nominal scale:

(
    so.Plot(diamonds, "price", "clarity")
    .add(so.Scatter(), move=so.Jitter(.8))
    .limit(x=(0, 20000), y=["VS1", "SI2"])
)

image

Closes #2871

@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #2898 (8461bc0) into master (3c8447f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2898   +/-   ##
=======================================
  Coverage   98.20%   98.20%           
=======================================
  Files          69       69           
  Lines       22561    22601   +40     
=======================================
+ Hits        22156    22196   +40     
  Misses        405      405           
Impacted Files Coverage Δ
seaborn/_core/plot.py 94.80% <100.00%> (+0.18%) ⬆️
tests/_core/test_plot.py 98.42% <100.00%> (+0.02%) ⬆️

@mwaskom mwaskom merged commit 17f44b5 into master Jul 12, 2022
@mwaskom mwaskom deleted the plot/limit branch July 12, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No easy way to set axis limits
1 participant