Skip to content

Commit ac0a423

Browse files
authored
Merge pull request #14832 from sameshl/tick_formatter_limits
API: make default tick formatter switch to scientific notation earlier
2 parents 47c0764 + 289284a commit ac0a423

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Reduced default value of `axes.formatter.limits`
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Changed the default value of `axes.formatter.limits` from -7, 7 to -5, 6 for better readability.

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ def _validate_linestyle(ls):
11501150
'axes.labelpad': [4.0, validate_float], # space between label and axis
11511151
'axes.labelweight': ['normal', validate_string], # fontsize of the x any y labels
11521152
'axes.labelcolor': ['black', validate_color], # color of axis label
1153-
'axes.formatter.limits': [[-7, 7], validate_nseq_int(2)],
1153+
'axes.formatter.limits': [[-5, 6], validate_nseq_int(2)],
11541154
# use scientific notation if log10
11551155
# of the axis range is smaller than the
11561156
# first or larger than the second

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,9 @@ def test_single_point():
547547

548548
@image_comparison(['single_date.png'], style='mpl20')
549549
def test_single_date():
550+
# use former defaults to match existing baseline image
551+
plt.rcParams['axes.formatter.limits'] = -7, 7
552+
550553
time1 = [721964.0]
551554
data1 = [-65.54]
552555

lib/matplotlib/tests/test_units.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def default_units(value, axis):
7676
@image_comparison(['plot_pint.png'], remove_text=False, style='mpl20',
7777
tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
7878
def test_numpy_facade(quantity_converter):
79+
# use former defaults to match existing baseline image
80+
plt.rcParams['axes.formatter.limits'] = -7, 7
81+
7982
# Register the class
8083
munits.registry[Quantity] = quantity_converter
8184

0 commit comments

Comments
 (0)