Skip to content

Commit bf2cd25

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.x'
2 parents 45c64e2 + fb4b061 commit bf2cd25

File tree

10 files changed

+234
-107
lines changed

10 files changed

+234
-107
lines changed

doc/devel/testing.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ example <https://travis-ci.org/msabramo/matplotlib>`_.
266266
Using tox
267267
---------
268268

269-
`Tox <http://tox.testrun.org/>`_ is a tool for running tests against
269+
`Tox <https://tox.readthedocs.io/en/latest/>`_ is a tool for running
270+
tests against
270271
multiple Python environments, including multiple versions of Python
271272
(e.g., 2.7, 3.4, 3.5) and even different Python implementations
272273
altogether (e.g., CPython, PyPy, Jython, etc.)

doc/resources/index.rst

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
Videos
3838
=======
3939

40-
* `Getting started with Matplotlib
41-
<http://showmedo.com/videotutorials/video?name=7200090&fromSeriesID=720>`_
42-
by `unpingco <http://showmedo.com/videotutorials/?author=6237>`_
43-
4440
* `Plotting with matplotlib <http://www.youtube.com/watch?v=P7SVi0YTIuE>`_
4541
by Mike Müller
4642

doc/users/colormaps.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,6 @@ References
186186
.. [mycarta-lablinear] http://mycarta.wordpress.com/2012/12/06/the-rainbow-is-deadlong-live-the-rainbow-part-5-cie-lab-linear-l-rainbow/
187187
.. [mycarta-cubelaw] http://mycarta.wordpress.com/2013/02/21/perceptual-rainbow-palette-the-method/
188188
.. [bw] http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/
189-
.. [colorblindness] http://aspnetresources.com/tools/colorBlindness
189+
.. [colorblindness] http://www.color-blindness.com/
190190
.. [asp] http://aspnetresources.com/tools/colorBlindness
191191
.. [IBM] http://www.research.ibm.com/people/l/lloydt/color/color.HTM

doc/users/prev_whats_new/whats_new_1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ figures since the last call. Eric has done a lot of testing on the
6969
user interface toolkits and versions and platforms he has access to,
7070
but it is not possible to test them all, so please report problems to
7171
the `mailing list
72-
<http://mail.python.org/mailman/listinfo/matplotlib users>`__
72+
<https://mail.python.org/mailman/listinfo/matplotlib-users>`__
7373
and `bug tracker
7474
<http://github.com/matplotlib/matplotlib/issues>`__.
7575

lib/matplotlib/colorbar.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ def __init__(self, ax, cmap=None,
311311
self.locator = ticks # Handle default in _ticker()
312312
if format is None:
313313
if isinstance(self.norm, colors.LogNorm):
314-
self.formatter = ticker.LogFormatterMathtext()
314+
self.formatter = ticker.LogFormatterSciNotation()
315+
elif isinstance(self.norm, colors.SymLogNorm):
316+
self.formatter = ticker.LogFormatterSciNotation(
317+
linthresh=self.norm.linthresh)
315318
else:
316319
self.formatter = ticker.ScalarFormatter()
317320
elif cbook.is_string_like(format):
@@ -579,7 +582,14 @@ def _ticker(self):
579582
b = self.norm.boundaries
580583
locator = ticker.FixedLocator(b, nbins=10)
581584
elif isinstance(self.norm, colors.LogNorm):
582-
locator = ticker.LogLocator()
585+
locator = ticker.LogLocator(subs='all')
586+
elif isinstance(self.norm, colors.SymLogNorm):
587+
# The subs setting here should be replaced
588+
# by logic in the locator.
589+
locator = ticker.SymmetricalLogLocator(
590+
subs=np.arange(1, 10),
591+
linthresh=self.norm.linthresh,
592+
base=10)
583593
else:
584594
if mpl.rcParams['_internal.classic_mode']:
585595
locator = ticker.MaxNLocator()

lib/matplotlib/pylab.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@
225225
import matplotlib as mpl
226226
# make mpl.finance module available for backwards compatability, in case folks
227227
# using pylab interface depended on not having to import it
228-
import matplotlib.finance
228+
with warnings.catch_warnings():
229+
warnings.simplefilter("ignore") # deprecation: moved to a toolkit
230+
import matplotlib.finance
229231

230232
from matplotlib.dates import (
231233
date2num, num2date, datestr2num, strpdate2num, drange, epoch2num,

lib/matplotlib/scale.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ def set_default_locators_and_formatters(self, axis):
249249
axis.set_major_locator(LogLocator(self.base))
250250
axis.set_major_formatter(LogFormatterSciNotation(self.base))
251251
axis.set_minor_locator(LogLocator(self.base, self.subs))
252-
axis.set_minor_formatter(LogFormatterSciNotation(self.base, self.subs))
252+
axis.set_minor_formatter(
253+
LogFormatterSciNotation(self.base,
254+
labelOnlyBase=self.subs))
253255

254256
def get_transform(self):
255257
"""

lib/matplotlib/tests/test_scale.py

+5
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,8 @@ def test_log_scatter():
4646

4747
buf = io.BytesIO()
4848
fig.savefig(buf, format='svg')
49+
50+
51+
if __name__ == '__main__':
52+
import nose
53+
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

lib/matplotlib/tests/test_ticker.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ def test_SymmetricalLogLocator_set_params():
164164
See if change was successful.
165165
Should not exception.
166166
"""
167-
# since we only test for the params change. I will pass empty transform
168-
sym = mticker.SymmetricalLogLocator(None)
167+
sym = mticker.SymmetricalLogLocator(base=10, linthresh=1)
169168
sym.set_params(subs=[2.0], numticks=8)
170169
assert sym._subs == [2.0]
171170
assert sym.numticks == 8
@@ -245,7 +244,7 @@ def test_LogFormatter_sublabel():
245244
ax.xaxis.set_major_locator(mticker.LogLocator(base=10, subs=[]))
246245
ax.xaxis.set_minor_locator(mticker.LogLocator(base=10,
247246
subs=np.arange(2, 10)))
248-
ax.xaxis.set_major_formatter(mticker.LogFormatter())
247+
ax.xaxis.set_major_formatter(mticker.LogFormatter(labelOnlyBase=True))
249248
ax.xaxis.set_minor_formatter(mticker.LogFormatter(labelOnlyBase=False))
250249
# axis range above 3 decades, only bases are labeled
251250
ax.set_xlim(1, 1e4)
@@ -266,9 +265,13 @@ def test_LogFormatter_sublabel():
266265
ax.set_xlim(1, 80)
267266
_sub_labels(ax.xaxis, subs=[])
268267

269-
# axis range at 0 to 1 decades, label subs 2, 3, 6
268+
# axis range at 0.4 to 1 decades, label subs 2, 3, 4, 6
270269
ax.set_xlim(1, 8)
271-
_sub_labels(ax.xaxis, subs=[2, 3, 6])
270+
_sub_labels(ax.xaxis, subs=[2, 3, 4, 6])
271+
272+
# axis range at 0 to 0.4 decades, label all
273+
ax.set_xlim(0.5, 0.9)
274+
_sub_labels(ax.xaxis, subs=np.arange(2, 10, dtype=int))
272275

273276

274277
class FakeAxis(object):

0 commit comments

Comments
 (0)