| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The bottom limit of log-scaled bar/hist plots now defaults to applying normal 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.
| Back | FazBrowse Home | New Git URL |
See changelog.
e.g.
from matplotlib import pyplot as plt fig, 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

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 are https://github.com/matplotlib/matplotlib/blob/v3.1.0/lib/matplotlib/tests/baseline_images/test_axes/hist_steplog.png, which is now

(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