Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make logscale bar/hist autolimits more consistents.#14581

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 1 commit intomatplotlib:masterfromanntzer:barlog
Aug 12, 2019

Conversation

anntzer
Copy link
Contributor

@anntzeranntzer commentedJun 20, 2019
edited
Loading

See changelog.

e.g.

from matplotlib import pyplot as pltfig, axs = plt.subplots(3, 3)axs[0, 0].set_yscale("log")axs[0, 0].bar(0, 1)axs[0, 0].set_title("log-then-bar")axs[0, 1].bar(0, 1)axs[0, 1].set_yscale("log")axs[0, 1].set_title("bar-then-log")axs[0, 2].bar(0, 1, log=True)axs[0, 2].set_title("bar(log=True)")axs[1, 0].set_yscale("log")axs[1, 0].hist(1, 1, histtype="step")axs[1, 0].set_title("log-then-hist(step)")axs[1, 1].hist(1, 1, histtype="step")axs[1, 1].set_yscale("log")axs[1, 1].set_title("hist(step)-then-log")axs[1, 2].hist(1, 1, histtype="step", log=True)axs[1, 2].set_title("hist(step, log=True)")axs[2, 0].set_yscale("log")axs[2, 0].hist(1, 1, histtype="stepfilled")axs[2, 0].set_title("log-then-hist(stepfilled)")axs[2, 1].hist(1, 1, histtype="stepfilled")axs[2, 1].set_yscale("log")axs[2, 1].set_title("hist(stepfilled)-then-log")axs[2, 2].hist(1, 1, histtype="stepfilled", log=True)axs[2, 2].set_title("hist(stepfilled, log=True)")plt.show()

This previously gave
old

This PR makes the all rows always use the "top right/bottom left" behavior. Because hist(histtype="bar") (the default) simply calls bar(), this PR also makes the behavior of hist() more consistent.

The deleted tests arehttps://github.com/matplotlib/matplotlib/blob/v3.1.0/lib/matplotlib/tests/baseline_images/test_axes/hist_steplog.png, which is now
hist_steplog
(the lower margin is much more reasonable IMO) and#4608 (now both histograms go to 1e-2 -- one because that's what's passed as bottom, the other one because it goes basically to minus infinity but relies on the other's sticky margin).

Closes#4621 (which is essentially the same as the issue demo'ed above).
Closes#14981.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzeranntzer changed the titleMake logscale bar autolimits more consistents.Make logscale bar/hist autolimits more consistents.Jun 24, 2019
@anntzeranntzerforce-pushed thebarlog branch 2 times, most recently from85e814f to7f80dabCompareJune 24, 2019 10:08
@anntzeranntzer added this to thev3.2.0 milestoneJul 18, 2019
The bottom limit of log-scaled bar/hist plots now defaults to applyingnormal margins (possibly with null limits expansion) to the data limits,rather than being hardcoded to 1/log_base.  See changelog.Delete two tests that asserted that the lower limit was at 1/log_base.
@tacaswelltacaswell added the Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelAug 5, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

Barplot call crashes when called with yscale="log" and bins with h=0 Default bottom of Stepfilled histograms should be set according to ymin
4 participants
@anntzer@timhoffm@dstansby@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp