diff --git a/.gitignore b/.gitignore index 8d7c0a4..305e1af 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,7 @@ target/ # image comparison baseline figcomp + +# exploratory things +*scratch* +__marimo__ diff --git a/probscale/probscale.py b/probscale/probscale.py index f802d18..d489761 100644 --- a/probscale/probscale.py +++ b/probscale/probscale.py @@ -227,6 +227,7 @@ def set_default_locators_and_formatters(self, axis: Axis) -> None: axis.set_major_formatter(FuncFormatter(PctFormatter())) else: axis.set_major_formatter(FuncFormatter(ProbFormatter())) + axis.set_minor_locator(NullLocator()) axis.set_minor_formatter(NullFormatter()) diff --git a/probscale/tests/test_viz.py b/probscale/tests/test_viz.py index c596aaf..5378468 100644 --- a/probscale/tests/test_viz.py +++ b/probscale/tests/test_viz.py @@ -1051,7 +1051,14 @@ def test_probplot_test_results(plot_data): @pytest.mark.parametrize("probax", ["x", "y"]) @pytest.mark.parametrize( ("N", "minval", "maxval"), - [(5, 10, 90), (8, 5, 95), (37, 1, 99), (101, 0.1, 99.9), (10001, 0.001, 99.999)], + [ + (5, 10, 90), + (8, 5, 95), + (37, 1, 99), + (100, 0.1, 99.9), + (101, 0.1, 99.9), + (10001, 0.001, 99.999), + ], ) def test__set_prob_limits_x(probax, N, minval, maxval): from probscale import validate diff --git a/probscale/viz.py b/probscale/viz.py index b4c194f..84c90d0 100644 --- a/probscale/viz.py +++ b/probscale/viz.py @@ -488,10 +488,11 @@ def _set_prob_limits(ax: Axes, probax: str, N: int) -> None: elif N <= 10: minval = 5 else: - minval = 10 ** (-1 * numpy.ceil(numpy.log10(N) - 2)) + minval = 10 ** (1 - numpy.floor(numpy.log10(N))) if which in ["x", "both"]: ax.set_xlim(left=minval, right=100 - minval) + elif which in ["y", "both"]: ax.set_ylim(bottom=minval, top=100 - minval)