Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ target/
# image comparison
baseline
figcomp

# exploratory things
*scratch*
__marimo__
1 change: 1 addition & 0 deletions probscale/probscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
9 changes: 8 additions & 1 deletion probscale/tests/test_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion probscale/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading