diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 188d991981a6..72b19b5d11e4 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -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, diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index afe9aecc9e6a..bc595d32634c 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -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 diff --git a/lib/matplotlib/testing/decorators.py b/lib/matplotlib/testing/decorators.py index f9a39fb6c500..1614bd004ab3 100644 --- a/lib/matplotlib/testing/decorators.py +++ b/lib/matplotlib/testing/decorators.py @@ -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, \ @@ -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) @@ -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 diff --git a/lib/matplotlib/tests/__init__.py b/lib/matplotlib/tests/__init__.py index c2900b57a76d..e3293907951b 100644 --- a/lib/matplotlib/tests/__init__.py +++ b/lib/matplotlib/tests/__init__.py @@ -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. @@ -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, diff --git a/lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf b/lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf index 92d378e13e62..219bdc694d83 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf and b/lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf differ diff --git a/lib/matplotlib/tests/baseline_images/test_axes/symlog.png b/lib/matplotlib/tests/baseline_images/test_axes/symlog.png index 03557d68d10c..8abdc4f314e6 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_axes/symlog.png and b/lib/matplotlib/tests/baseline_images/test_axes/symlog.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg b/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg index 9ef7004e5d17..b5bb297baa47 100644 --- a/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg +++ b/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg @@ -10,96 +10,96 @@ - - - - - - - - + - + - + - + - @@ -110,39 +110,39 @@ Q 19.53125 74.21875 31.78125 74.21875 - + - + - @@ -154,28 +154,28 @@ z - + - + - @@ -188,12 +188,12 @@ z - + - + @@ -207,39 +207,39 @@ z - + - + - @@ -251,12 +251,12 @@ Q 31.109375 20.453125 19.1875 8.296875 - + - + @@ -272,22 +272,22 @@ Q 31.109375 20.453125 19.1875 8.296875 - + - + - + - + @@ -300,371 +300,371 @@ L -4 0 - + - + - - - - + + + + - + - + - - - - + + + + - + - + - - - - + + + + - + - + - - - - - + + + + - + - + - - - - - + + + + - + - + - - - - + + + + - + - + - - - - - + + + + - + - + - - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -672,7 +672,7 @@ L -2 0 - + diff --git a/lib/matplotlib/tests/baseline_images/test_text/text_alignment.pdf b/lib/matplotlib/tests/baseline_images/test_text/text_alignment.pdf index 8652c71c2ed5..e6199559b9da 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_text/text_alignment.pdf and b/lib/matplotlib/tests/baseline_images/test_text/text_alignment.pdf differ diff --git a/lib/matplotlib/tests/baseline_images/test_text/text_alignment.png b/lib/matplotlib/tests/baseline_images/test_text/text_alignment.png index 9ebb4c578593..a4f11d9fac9d 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_text/text_alignment.png and b/lib/matplotlib/tests/baseline_images/test_text/text_alignment.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_text/text_alignment.svg b/lib/matplotlib/tests/baseline_images/test_text/text_alignment.svg index 902801f3962d..2e1ab2a7c384 100644 --- a/lib/matplotlib/tests/baseline_images/test_text/text_alignment.svg +++ b/lib/matplotlib/tests/baseline_images/test_text/text_alignment.svg @@ -5,740 +5,853 @@ - - - + - + - + - + - + - + - - - - + + - + - + - +" id="BitstreamVeraSans-Roman-74"/> + - - - - - - + + + + + + - + + - + + - - - +" id="Cmex10-58"/> - - - - - - + + + + + + - - - + +" id="BitstreamVeraSans-Roman-62"/> - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - - + - - + - - + + - + +M52.2031 31.2031 +L52.2031 0 +L43.2188 0 +L43.2188 8.29688 +Q40.1406 3.32812 35.5469 0.953125 +Q30.9531 -1.42188 24.3125 -1.42188 +Q15.9219 -1.42188 10.9531 3.29688 +Q6 8.01562 6 15.9219 +Q6 25.1406 12.1719 29.8281 +Q18.3594 34.5156 30.6094 34.5156 +L43.2188 34.5156 +L43.2188 35.4062 +Q43.2188 41.6094 39.1406 45 +Q35.0625 48.3906 27.6875 48.3906 +Q23 48.3906 18.5469 47.2656 +Q14.1094 46.1406 10.0156 43.8906 +L10.0156 52.2031 +Q14.9375 54.1094 19.5781 55.0469 +Q24.2188 56 28.6094 56 +Q40.4844 56 46.3438 49.8438 +Q52.2031 43.7031 52.2031 31.2031" id="BitstreamVeraSans-Roman-61"/> + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - +" id="BitstreamVeraSans-Roman-72"/> + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - + diff --git a/matplotlibrc.template b/matplotlibrc.template index 01efc3bc23ee..0eae9f44075a 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -353,7 +353,7 @@ backend : %(backend)s ### IMAGES #image.aspect : equal # equal | auto | a number -#image.interpolation : bilinear # see help(imshow) for options +#image.interpolation : nearest # see help(imshow) for options #image.cmap : jet # gray | jet etc... #image.lut : 256 # the size of the colormap lookup table #image.origin : upper # lower | upper