diff --git a/.travis.yml b/.travis.yml index 08b835a3a850..a1ccdcba6e9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ install: script: - mkdir ../foo - cd ../foo - - python ../matplotlib/tests.py + - python ../matplotlib/tests.py -sv diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index 0f8ba4346837..fc7c0c700523 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -48,6 +48,12 @@ arguments works from within Python:: import matplotlib matplotlib.test() +Unlike :file:`tests.py` this does not run any tests of the matplotlib +toolkits. They can however be tested from within Python in a similar +way:: + + import mpl_toolkits + mpl_toolkits.test() .. _`nosetest arguments`: http://somethingaboutorange.com/mrl/projects/nose/1.0.0/usage.html diff --git a/lib/matplotlib/mpl-data/sample_data/axes_grid/random_xy.npy b/lib/matplotlib/mpl-data/sample_data/axes_grid/random_xy.npy new file mode 100644 index 000000000000..132db14140cb Binary files /dev/null and b/lib/matplotlib/mpl-data/sample_data/axes_grid/random_xy.npy differ diff --git a/lib/mpl_toolkits/__init__.py b/lib/mpl_toolkits/__init__.py index 8d9942e652d5..1883bb06930e 100644 --- a/lib/mpl_toolkits/__init__.py +++ b/lib/mpl_toolkits/__init__.py @@ -1,4 +1,51 @@ +import sys +from matplotlib import Verbose +from matplotlib import rcParams +from matplotlib import __version__ +from matplotlib import use + +verbose = Verbose() + try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: pass # must not have setuptools + +toolkits_test_modules = [ + 'mpl_toolkits.tests.test_axesgrid1', + ] + +def test(verbosity=1): + """run the matplotlib test suite""" + old_backend = rcParams['backend'] + try: + use('agg') + import nose + import nose.plugins.builtin + from matplotlib.testing.noseclasses import KnownFailure + from nose.plugins.manager import PluginManager + + # store the old values before overriding + plugins = [] + plugins.append( KnownFailure() ) + plugins.extend( [plugin() for plugin in nose.plugins.builtin.plugins] ) + + manager = PluginManager(plugins = plugins) + config = nose.config.Config(verbosity = verbosity, plugins = manager) + + success = nose.run( defaultTest = toolkits_test_modules, + config=config, + ) + finally: + if old_backend.lower() != 'agg': + use(old_backend) + + return success + +test.__test__ = False # nose: this function is not a test + +verbose.report('matplotlib version %s'%__version__) +verbose.report('verbose.level %s'%verbose.level) +verbose.report('interactive is %s'%rcParams['interactive']) +verbose.report('platform is %s'%sys.platform) +verbose.report('loaded modules: %s'%sys.modules.iterkeys(), 'debug') diff --git a/lib/mpl_toolkits/tests/__init__.py b/lib/mpl_toolkits/tests/__init__.py new file mode 100644 index 000000000000..9f6152124e03 --- /dev/null +++ b/lib/mpl_toolkits/tests/__init__.py @@ -0,0 +1,16 @@ +from __future__ import print_function +from matplotlib import rcParams, rcdefaults, use + +_multiprocess_can_split_ = True + +def setup(): + use('Agg', warn=False) # use Agg backend for these tests + + # These settings *must* be hardcoded for running the comparison + # tests and are not necessarily the default values as specified in + # rcsetup.py + rcdefaults() # Start with all defaults + rcParams['font.family'] = 'Bitstream Vera Sans' + rcParams['text.hinting'] = False + rcParams['text.hinting_factor'] = 8 + rcParams['text.antialiased'] = False diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.pdf new file mode 100644 index 000000000000..19e4602b6d4f Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.png new file mode 100644 index 000000000000..bedfcc50da0d Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.svg new file mode 100644 index 000000000000..57dd773f5b07 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/InsetLocator.svg @@ -0,0 +1,1169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.pdf new file mode 100644 index 000000000000..1ec31f1c7516 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.png new file mode 100644 index 000000000000..01b27db9385c Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.svg new file mode 100644 index 000000000000..09df548a41e0 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twin.svg @@ -0,0 +1,1255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.pdf new file mode 100644 index 000000000000..85a3cfa5f237 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.png new file mode 100644 index 000000000000..20e9d1ea4d80 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.svg new file mode 100644 index 000000000000..c3c42e3697b4 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ParasiteAxes_twinx.svg @@ -0,0 +1,897 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.pdf new file mode 100644 index 000000000000..e61112ca2888 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.png new file mode 100644 index 000000000000..6be90e431217 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.svg new file mode 100644 index 000000000000..0b5577d55dca --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/RGBAxes.svg @@ -0,0 +1,904 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.pdf new file mode 100644 index 000000000000..d30532fac140 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.png new file mode 100644 index 000000000000..96a4f3d7485b Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.svg new file mode 100644 index 000000000000..88b991a499b3 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/ZoomedInsetLocator.svg @@ -0,0 +1,722 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.pdf new file mode 100644 index 000000000000..d8d6cdfe22c6 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.png new file mode 100644 index 000000000000..a06dc0925765 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.svg new file mode 100644 index 000000000000..ed15f72aa176 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_each_cbar.svg @@ -0,0 +1,10123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.pdf new file mode 100644 index 000000000000..6dac7d53281b Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.png new file mode 100644 index 000000000000..538b6e4e5d89 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.svg new file mode 100644 index 000000000000..8816ed40f9c5 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/grid_with_single_cbar.svg @@ -0,0 +1,3012 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.pdf new file mode 100644 index 000000000000..2c2705e19310 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.png new file mode 100644 index 000000000000..50cd4d5adf03 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.svg new file mode 100644 index 000000000000..73d3263bb08d --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/imagegrid.svg @@ -0,0 +1,1020 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.pdf new file mode 100644 index 000000000000..be0ed1804da3 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.png new file mode 100644 index 000000000000..116d3912969f Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.svg new file mode 100644 index 000000000000..80e8a162fc97 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/scatter.svg @@ -0,0 +1,4562 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.pdf b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.pdf new file mode 100644 index 000000000000..1f47f6dcd8c8 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.pdf differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.png b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.png new file mode 100644 index 000000000000..76d14e670b05 Binary files /dev/null and b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.png differ diff --git a/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.svg b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.svg new file mode 100644 index 000000000000..f60b4e352af9 --- /dev/null +++ b/lib/mpl_toolkits/tests/baseline_images/test_axesgrid1/simple_grid.svg @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/mpl_toolkits/tests/test_axesgrid1.py b/lib/mpl_toolkits/tests/test_axesgrid1.py new file mode 100644 index 000000000000..389f951e8a1e --- /dev/null +++ b/lib/mpl_toolkits/tests/test_axesgrid1.py @@ -0,0 +1,332 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.transforms as mtransforms +from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid +from mpl_toolkits.axes_grid1 import make_axes_locatable, host_subplot +from mpl_toolkits.axes_grid1.parasite_axes import SubplotHost +from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes +from mpl_toolkits.axes_grid1.inset_locator import mark_inset +from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar +from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes +from matplotlib.testing.decorators import image_comparison + + +def get_demo_image(): + """ + Load image used for tests. + """ + from matplotlib.cbook import get_sample_data + f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) + z = np.load(f) + # z is a numpy array of 15x15 + return z, (-3, 4, -4, 3) + +def get_random_data(): + """ + Load "random" data used for tests. + """ + from matplotlib.cbook import get_sample_data + f = get_sample_data("axes_grid/random_xy.npy", asfileobj=False) + [x, y] = np.load(f) + # z is a numpy array of 15x15 + return x, y + +def add_sizebar(ax, size): + asb = AnchoredSizeBar(ax.transData, + size, + str(size), + loc=8, + pad=0.1, borderpad=0.5, sep=5, + frameon=False) + ax.add_artist(asb) + +def get_rgb(): + Z, extent = get_demo_image() + Z[Z<0] = 0. + Z = Z/Z.max() + R = Z[:13,:13] + G = Z[2:,2:] + B = Z[:13,2:] + return R, G, B + + +@image_comparison(baseline_images=['imagegrid']) +def test_imagegrid(): + """Test imagegrid""" + + F = plt.figure(1, (5.5, 3.5)) + grid = ImageGrid(F, 111, # similar to subplot(111) + nrows_ncols = (1, 3), + axes_pad = 0.1, + add_all=True, + label_mode = "L", + ) + + Z, extent = get_demo_image() # demo image + + im1 = Z + im2 = Z[:, :10] + im3 = Z[:, 10:] + vmin, vmax = Z.min(), Z.max() + for i, im in enumerate([im1, im2, im3]): + ax = grid[i] + ax.imshow(im, origin="lower", vmin=vmin, vmax=vmax, + interpolation="nearest") + +@image_comparison(baseline_images=['simple_grid']) +def test_simple_grid(): + """ + A grid of 2x2 images with 0.05 inch pad between images and only + the lower-left axes is labeled. + """ + fig = plt.figure(1, (5.5, 3.5)) + grid = AxesGrid(fig, 111, # similar to subplot(131) + nrows_ncols = (2, 2), + axes_pad = 0.05, + label_mode = "1", + ) + + Z, extent = get_demo_image() + for i in range(4): + grid[i].imshow(Z, extent=extent, interpolation="nearest") + + # This only affects axes in first column and second row as + # share_all = False. + grid.axes_llc.set_xticks([-2, 0, 2]) + grid.axes_llc.set_yticks([-2, 0, 2]) + +@image_comparison(baseline_images=['grid_with_single_cbar']) +def test_grid_with_single_cbar(): + """ + A grid of 2x2 images with a single colorbar + """ + fig = plt.figure(1, (5.5, 3.5)) + grid = AxesGrid(fig, 111, # similar to subplot(132) + nrows_ncols = (2, 2), + axes_pad = 0.0, + share_all = True, + label_mode = "L", + cbar_location = "top", + cbar_mode = "single", + ) + + Z, extent = get_demo_image() + for i in range(4): + im = grid[i].imshow(Z, extent=extent, interpolation="nearest") + grid.cbar_axes[0].colorbar(im) + + for cax in grid.cbar_axes: + cax.toggle_label(False) + + # This affects all axes as share_all = True. + grid.axes_llc.set_xticks([-2, 0, 2]) + grid.axes_llc.set_yticks([-2, 0, 2]) + +@image_comparison(baseline_images=['grid_with_each_cbar']) +def test_grid_with_each_cbar(): + """ + A grid of 2x2 images. Each image has its own colorbar. + """ + fig = plt.figure(1, (5.5, 3.5)) + grid = AxesGrid(fig, 111, # similar to subplot(122) + nrows_ncols = (2, 2), + axes_pad = 0.1, + label_mode = "1", + share_all = True, + cbar_location="top", + cbar_mode="each", + cbar_size="7%", + cbar_pad="2%", + ) + Z, extent = get_demo_image() + for i in range(4): + im = grid[i].imshow(Z, extent=extent, interpolation="nearest") + grid.cbar_axes[i].colorbar(im) + + for cax in grid.cbar_axes: + cax.toggle_label(False) + + # This affects all axes because we set share_all = True. + grid.axes_llc.set_xticks([-2, 0, 2]) + grid.axes_llc.set_yticks([-2, 0, 2]) + +@image_comparison(baseline_images=['scatter']) +def test_scatter(): + # the random data + x, y = get_random_data() + + fig = plt.figure(1, figsize=(5.5, 5.5)) + + # the scatter plot: + axScatter = plt.subplot(111) + axScatter.scatter(x, y) + axScatter.set_aspect(1.) + + # create new axes on the right and on the top of the current axes + # The first argument of the new_vertical(new_horizontal) method is + # the height (width) of the axes to be created in inches. + divider = make_axes_locatable(axScatter) + axHistx = divider.append_axes("top", 1.2, pad=0.1, sharex=axScatter) + axHisty = divider.append_axes("right", 1.2, pad=0.1, sharey=axScatter) + + # make some labels invisible + plt.setp(axHistx.get_xticklabels() + axHisty.get_yticklabels(), + visible=False) + + # now determine nice limits by hand: + binwidth = 0.25 + xymax = np.max( [np.max(np.fabs(x)), np.max(np.fabs(y))] ) + lim = ( int(xymax/binwidth) + 1) * binwidth + + bins = np.arange(-lim, lim + binwidth, binwidth) + axHistx.hist(x, bins=bins) + axHisty.hist(y, bins=bins, orientation='horizontal') + + # the xaxis of axHistx and yaxis of axHisty are shared with axScatter, + # thus there is no need to manually adjust the xlim and ylim of these + # axis. + + #axHistx.axis["bottom"].major_ticklabels.set_visible(False) + for tl in axHistx.get_xticklabels(): + tl.set_visible(False) + axHistx.set_yticks([0, 50, 100]) + + #axHisty.axis["left"].major_ticklabels.set_visible(False) + for tl in axHisty.get_yticklabels(): + tl.set_visible(False) + axHisty.set_xticks([0, 50, 100]) + +@image_comparison(baseline_images=['ParasiteAxes_twinx']) +def test_ParasiteAxes_twinx(): + + host = host_subplot(111) + par = host.twinx() + + host.set_xlabel("Distance") + host.set_ylabel("Density") + par.set_ylabel("Temperature") + + p1, = host.plot([0, 1, 2], [0, 1, 2], label="Density") + p2, = par.plot([0, 1, 2], [0, 3, 2], label="Temperature") + + leg = plt.legend() + + host.yaxis.get_label().set_color(p1.get_color()) + leg.texts[0].set_color(p1.get_color()) + + par.yaxis.get_label().set_color(p2.get_color()) + leg.texts[1].set_color(p2.get_color()) + +@image_comparison(baseline_images=['ParasiteAxes_twin']) +def test_ParasiteAxes_twin(): + obs = [["01_S1", 3.88, 0.14, 1970, 63], + ["01_S4", 5.6, 0.82, 1622, 150], + ["02_S1", 2.4, 0.54, 1570, 40], + ["03_S1", 4.1, 0.62, 2380, 170]] + + + fig = plt.figure() + + ax_kms = SubplotHost(fig, 1, 1, 1, aspect=1.) + + # angular proper motion("/yr) to linear velocity(km/s) at distance=2.3kpc + pm_to_kms = 1./206265.*2300*3.085e18/3.15e7/1.e5 + + aux_trans = mtransforms.Affine2D().scale(pm_to_kms, 1.) + ax_pm = ax_kms.twin(aux_trans) + ax_pm.set_viewlim_mode("transform") + + fig.add_subplot(ax_kms) + + for n, ds, dse, w, we in obs: + time = ((2007+(10. + 4/30.)/12)-1988.5) + v = ds / time * pm_to_kms + ve = dse / time * pm_to_kms + ax_kms.errorbar([v], [w], xerr=[ve], yerr=[we], color="k", label=n) + + ax_kms.axis["bottom"].set_label("Linear velocity at 2.3 kpc [km/s]") + ax_kms.axis["left"].set_label("FWHM [km/s]") + ax_pm.axis["top"].set_label("Proper Motion [$^{''}$/yr]") + ax_pm.axis["top"].label.set_visible(True) + ax_pm.axis["right"].major_ticklabels.set_visible(False) + + ax_kms.set_xlim(950, 3700) + ax_kms.set_ylim(950, 3100) + # xlim and ylim of ax_pms will be automatically adjusted. + +@image_comparison(baseline_images=['InsetLocator']) +def test_InsetLocator(): + fig = plt.figure(1, [5.5, 3]) + + # first subplot + ax = fig.add_subplot(1, 2, 1) + ax.set_aspect(1.) + + axins = inset_axes(ax, + width="30%", # width = 30% of parent_bbox + height=1., # height : 1 inch + loc=3) + + plt.xticks(visible=False) + plt.yticks(visible=False) + + # second subplot + ax = fig.add_subplot(1, 2, 2) + ax.set_aspect(1.) + + axins = zoomed_inset_axes(ax, 0.5, loc=1) # zoom = 0.5 + + plt.xticks(visible=False) + plt.yticks(visible=False) + + add_sizebar(ax, 0.5) + add_sizebar(axins, 0.5) + +@image_comparison(baseline_images=['ZoomedInsetLocator']) +def test_ZoomedInsetLocator(): + fig = plt.figure(1, [5, 4]) + ax = fig.add_subplot(111) + + # prepare the demo image + Z, extent = get_demo_image() + Z2 = np.zeros([150, 150], dtype="d") + ny, nx = Z.shape + Z2[30:30+ny, 30:30+nx] = Z + + # extent = [-3, 4, -4, 3] + ax.imshow(Z2, extent=extent, interpolation="nearest", + origin="lower") + + axins = zoomed_inset_axes(ax, 6, loc=1) # zoom = 6 + axins.imshow(Z2, extent=extent, interpolation="nearest", + origin="lower") + + # sub region of the original image + x1, x2, y1, y2 = -1.5, -0.9, -2.5, -1.9 + axins.set_xlim(x1, x2) + axins.set_ylim(y1, y2) + + plt.xticks(visible=False) + plt.yticks(visible=False) + + # draw a bbox of the region of the inset axes in the parent axes and + # connecting lines between the bbox and the inset axes area + mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5") + + +@image_comparison(baseline_images=['RGBAxes']) +def test_RGBAxes(): + fig = plt.figure(1) + ax = RGBAxes(fig, [0.1, 0.1, 0.8, 0.8]) + + r, g, b = get_rgb() + kwargs = dict(origin="lower", interpolation="nearest") + ax.imshow_rgb(r, g, b, **kwargs) + + ax.RGB.set_xlim(0., 9.5) + ax.RGB.set_ylim(0.9, 10.6) + + +if __name__ == '__main__': + import nose + nose.runmodule(argv=['-s', '--with-doctest'], exit=False) diff --git a/setup.py b/setup.py index 35a60dc63cd4..bc420ef3695a 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', + 'mpl_toolkits.tests', 'matplotlib.sphinxext', 'matplotlib.tri', @@ -117,7 +118,9 @@ 'mpl-data/sample_data/*.*', 'mpl-data/sample_data/axes_grid/*.*', 'backends/Matplotlib.nib/*', - ]} + ], + 'mpl_toolkits':[] + } package_dir = {'': 'lib'} @@ -125,13 +128,19 @@ # TODO: exclude these when making release? baseline_images = glob.glob(os.path.join('lib','matplotlib','tests', 'baseline_images','*','*')) - def chop_package(fname): - badstr = os.path.join('lib','matplotlib','') + def chop_package(fname,lib): + badstr = os.path.join('lib',lib,'') assert fname.startswith(badstr) result = fname[ len(badstr): ] return result - baseline_images = [chop_package(f) for f in baseline_images] + baseline_images = [chop_package(f,lib='matplotlib') for f in baseline_images] package_data['matplotlib'].extend(baseline_images) + + baseline_images_mpl = glob.glob(os.path.join('lib','mpl_toolkits','tests', + 'baseline_images','*','*')) + baseline_images_mpl = [chop_package(f,lib='mpl_toolkits') for f in baseline_images_mpl] + package_data['mpl_toolkits'].extend(baseline_images_mpl) + package_data['matplotlib'].append('tests/mpltest.ttf') package_data['matplotlib'].append('tests/test_rcparams.rc') diff --git a/tests.py b/tests.py index 375abaab5ca0..3fa3fa5b3972 100755 --- a/tests.py +++ b/tests.py @@ -11,10 +11,11 @@ import nose from matplotlib.testing.noseclasses import KnownFailure from matplotlib import default_test_modules +from mpl_toolkits import toolkits_test_modules def run(): - nose.main(addplugins=[KnownFailure()], - defaultTest=default_test_modules) + nose.main(addplugins = [KnownFailure()], + defaultTest = default_test_modules + toolkits_test_modules) if __name__ == '__main__': run()