Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Default interpolation #5438

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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: 2 additions & 2 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,8 @@ class NonUniformImage(AxesImage):
def __init__(self, ax, **kwargs):
"""
kwargs are identical to those for AxesImage, except
that 'interpolation' defaults to 'nearest', and 'bilinear'
is the only alternative.
that 'nearest' and 'bilinear' are the only supported 'interpolation'
options.
"""
interp = kwargs.pop('interpolation', 'nearest')
AxesImage.__init__(self, ax,
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def validate_cycler(s):
'mathtext.fallback_to_cm': [True, validate_bool],

'image.aspect': ['equal', validate_aspect], # equal, auto, a number
'image.interpolation': ['bilinear', six.text_type],
'image.interpolation': ['nearest', six.text_type],
'image.cmap': ['jet', six.text_type], # one of gray, jet, etc
'image.lut': [256, validate_int], # lookup table
'image.origin': ['upper', six.text_type], # lookup table
Expand Down
7 changes: 3 additions & 4 deletions lib/matplotlib/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from matplotlib import ticker
from matplotlib import pyplot as plt
from matplotlib import ft2font
from matplotlib import rcParams
from matplotlib.testing.noseclasses import KnownFailureTest, \
KnownFailureDidNotFailTest, ImageComparisonFailure
from matplotlib.testing.compare import comparable_formats, compare_images, \
Expand Down Expand Up @@ -138,6 +139,7 @@ def check_freetype_version(ver):
class ImageComparisonTest(CleanupTest):
@classmethod
def setup_class(cls):
CleanupTest.setup_class()
cls._initial_settings = mpl.rcParams.copy()
try:
matplotlib.style.use(cls._style)
Expand All @@ -146,11 +148,8 @@ def setup_class(cls):
mpl.rcParams.clear()
mpl.rcParams.update(cls._initial_settings)
raise
# Because the setup of a CleanupTest might involve
# modifying a few rcparams, this setup should come
# last prior to running the image test.
CleanupTest.setup_class()
cls.original_settings = cls._initial_settings
matplotlib.tests.set_font_settings_for_testing()
cls._func()

@classmethod
Expand Down
11 changes: 8 additions & 3 deletions lib/matplotlib/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
'test data.')


def set_font_settings_for_testing():
rcParams['font.family'] = 'DejaVu Sans'
rcParams['text.hinting'] = False
rcParams['text.hinting_factor'] = 8


def setup():
# The baseline images are created in this locale, so we should use
# it during all of the tests.
Expand All @@ -45,9 +51,8 @@ def setup():
# tests and are not necessarily the default values as specified in
# rcsetup.py
rcdefaults() # Start with all defaults
rcParams['font.family'] = 'DejaVu Sans'
rcParams['text.hinting'] = False
rcParams['text.hinting_factor'] = 8

set_font_settings_for_testing()


def assert_str_equal(reference_str, test_str,
Expand Down
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf
Binary file not shown.
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/symlog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading