Skip to content

Commit 976ae9f

Browse files
committed
TST: add test for lits of number strings
1 parent 3243ba8 commit 976ae9f

File tree

7 files changed

+202
-536
lines changed

7 files changed

+202
-536
lines changed
Binary file not shown.
Loading

lib/matplotlib/tests/baseline_images/test_axes/scatter.svg

+190-511
Loading

lib/matplotlib/tests/test_axes.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -1686,16 +1686,16 @@ def test_hist2d_transpose():
16861686

16871687

16881688
class TestScatter(object):
1689-
@image_comparison(baseline_images=['scatter', 'scatter'])
1689+
@image_comparison(baseline_images=['scatter'],
1690+
style='mpl20', remove_text=True)
16901691
def test_scatter_plot(self):
1691-
fig, ax = plt.subplots()
1692-
data = {"x": [3, 4, 2, 6], "y": [2, 5, 2, 3],
1693-
"c": ['r', 'y', 'b', 'lime'], "s": [24, 15, 19, 29]}
1694-
1695-
ax.scatter(data["x"], data["y"], c=data["c"], s=data["s"])
1692+
data = {"x": np.array([3, 4, 2, 6]), "y": np.array([2, 5, 2, 3]),
1693+
"c": ['r', 'y', 'b', 'lime'], "s": [24, 15, 19, 29],
1694+
"c2": ['0.5', '0.6', '0.7', '0.8']}
16961695

1697-
# Reuse testcase from above for a labeled data test
16981696
fig, ax = plt.subplots()
1697+
ax.scatter(data["x"] - 1., data["y"] - 1., c=data["c"], s=data["s"])
1698+
ax.scatter(data["x"] + 1., data["y"] + 1., c=data["c2"], s=data["s"])
16991699
ax.scatter("x", "y", c="c", s="s", data=data)
17001700

17011701
@image_comparison(baseline_images=['scatter_marker'], remove_text=True,
@@ -1765,6 +1765,9 @@ def test_scatter_color(self):
17651765
([0.5]*3, None), # should emit a warning for user's eyes though
17661766
([0.5]*4, None), # NB: no warning as matching size allows mapping
17671767
([0.5]*5, "shape"),
1768+
# list of strings:
1769+
(['0.5', '0.4', '0.6', '0.7'], None),
1770+
(['0.5', 'red', '0.6', 'C5'], None),
17681771
# RGB values
17691772
([[1, 0, 0]], None),
17701773
([[1, 0, 0]]*3, "shape"),

setup.py

+2-18
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
error = """
1616
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4.
1717
Beginning with Matplotlib 3.0, Python 3.5 and above is required.
18+
1819
This may be due to an out of date pip.
20+
1921
Make sure you have pip >= 9.0.1.
2022
"""
2123
sys.exit(error)
2224

23-
import subprocess
2425
# The setuptools version of sdist adds a setup.cfg file to the tree.
2526
# We don't want that, so we simply remove it, and it will fall back to
2627
# vanilla distutils.
@@ -104,27 +105,10 @@ def build_extensions(self):
104105
self.compiler.compiler_so.remove('-Wstrict-prototypes')
105106
except (ValueError, AttributeError):
106107
pass
107-
if self._xcode_gte_10():
108-
# If compiling using Xcode >= 10, need to manually specify the
109-
# -stdlib flag because libstdc++ is no longer available
110-
for mod in self.distribution.ext_modules:
111-
mod.extra_compile_args = ['-stdlib=libc++']
112-
mod.extra_link_args = ['-stdlib=libc++']
113108
for package in good_packages:
114109
package.do_custom_build()
115110
return super().build_extensions()
116111

117-
def _xcode_gte_10(self):
118-
if sys.platform != "darwin":
119-
return False
120-
# Returns True if compiler is from Xcode version >= 10
121-
compiler_version = str(subprocess.check_output(
122-
self.compiler.compiler + ['--version'], universal_newlines=True))
123-
compiler_version = compiler_version.split(' ')
124-
return ((compiler_version[0] == 'Apple') and
125-
(compiler_version[1] == 'LLVM') and
126-
(int(compiler_version[3].split('.')[0]) >= 10))
127-
128112

129113
cmdclass = versioneer.get_cmdclass()
130114
cmdclass['test'] = NoopTestCommand

0 commit comments

Comments
 (0)