8000 Merge branch 'v2.x' into master · matplotlib/matplotlib@e66a88a · GitHub
[go: up one dir, main page]

Skip to content

Commit e66a88a

Browse files
committed
Merge branch 'v2.x' into master
2 parents acf2953 + 35aa62d commit e66a88a

File tree

5 files changed

+144
-4
lines changed

5 files changed

+144
-4
lines changed

10000 doc/_templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ <h1>Third party packages</h1>
180180

181181
<p>A large number of <a href="{{ pathto('thirdpartypackages/index') }}">third party packages</a>
182182
extend and build on Matplotlib functionality, including several higher-level plotting interfaces
183-
<a href="http://web.stanford.edu/~mwaskom/software/seaborn">seaborn</a>,
183+
<a href="https://seaborn.github.io/">seaborn</a>,
184184
<a href="http://holoviews.org">holoviews</a>,
185185
<a href="http://ggplot.yhathq.com">ggplot</a>, and
186186
two projection and mapping toolkits

doc/api/api_changes.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,34 @@ where "ax" is an ``Axes3d`` object created with something like ::
155155
ax = plt.sublot(111, projection='3d')
156156

157157

158+
Changes in 1.5.3
159+
================
160+
161+
``ax.plot(..., marker=None)`` gives default marker
162+
--------------------------------------------------
163+
164+
Prior to 1.5.3 kwargs passed to `~matplotlib.Axes.plot` were handled
165+
in two parts -- default kwargs generated internal to
166+
`~matplotlib.Axes.plot` (such as the cycled styles) and user supplied
167+
kwargs. The internally generated kwargs were passed to the
168+
`matplotlib.lines.Line2D.__init__` and the user kwargs were passed to
169+
``ln.set(**kwargs)`` to update the artist after it was created. Now
170+
both sets of kwargs are merged and passed to
171+
`~matplotlib.lines.Line2D.__init__`. This change was made to allow `None`
172+
to be passed in via the user kwargs to mean 'do the default thing' as
173+
is the convention through out mpl rather than raising an exception.
174+
175+
Unlike most `~matplotlib.lines.Line2D` setter methods
176+
`~matplotlib.lines.Line2D.set_marker` did accept `None` as a valid
177+
input which was mapped to 'no marker'. Thus, by routing this
178+
``marker=None`` through ``__init__`` rather than ``set(...)`` the meaning
179+
of ``ax.plot(..., marker=None)`` changed from 'no markers' to 'default markers
180+
from rcparams'.
181+
182+
This is change is only evident if ``mpl.rcParams['lines.marker']`` has a value
183+
other than ``'None'`` (which is string ``'None'`` which means 'no marker').
184+
185+
158186
Changes in 1.5.2
159187
================
160188

doc/mpl_toolkits/index.rst

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,102 @@ Excel Tools
7373
``mpl_toolkits.exceltools`` provides some utilities for working with
7474
Excel. This toolkit ships with matplotlib, but requires
7575
`xlwt <http://pypi.python.org/pypi/xlwt>`_
76+
77+
78+
.. _toolkit_natgrid:
79+
80+
Natgrid
81+
=======
82+
(*Not distributed with matplotlib*)
83+
84+
mpl_toolkits.natgrid is an interface to natgrid C library for gridding
85+
irregularly spaced data. This requires a separate installation of the
86+
`natgrid toolkit <http://github.com/matplotlib/natgrid>`__.
87+
88+
89+
.. _toolkit_matplotlibvenn:
90+
91+
Matplotlib-Venn
92+
===============
93+
(*Not distributed with matplotlib*)
94+
95+
`Matplotlib-Venn <https://github.com/konstantint/matplotlib-venn>`_ provides a set of functions for plotting 2- and 3-set area-weighted (or unweighted) Venn diagrams.
96+
97+
mplstereonet
98+
===============
99+
(*Not distributed with matplotlib*)
100+
101+
`mplstereonet <https://github.com/joferkington/mplstereonet>`_ provides stereonets for plotting and analyzing orientation data in Matplotlib.
102+
103+
104+
.. _hl_plotting:
105+
106+
High-Level Plotting
107+
*******************
108+
109+
Several projects have started to provide a higher-level interface to
110+
matplotlib. These are independent projects.
111+
112+
.. _toolkit_seaborn:
113+
114+
seaborn
115+
=======
116+
(*Not distributed with matplotlib*)
117+
118+
`seaborn <https://seaborn.github.io/>`_ is a high level interface for drawing
119+
statistical graphics with matplotlib. It aims to make visualization a central
120+
part of exploring and understanding complex datasets.
121+
122+
.. image:: /_static/seaborn.png
123+
:height: 157px
124+
125+
.. _toolkit_holoviews:
126+
127+
holoviews
128+
=========
129+
(*Not distributed with matplotlib*)
130+
131+
`holoviews <http://holoviews.org>`_ makes it easier to visualize data
132+
interactively, especially in a `Jupyter notebook
133+
<http://jupyter.org>`_, by providing a set of declarative
134+
plotting objects that store your data and associated metadata. Your
135+
data is then immediately visualizable alongside or overlaid with other
136+
data, either statically or with automatically provided widgets for
137+
parameter exploration.
138+
139+
.. image:: /_static/holoviews.png
140+
:height: 354px
141+
142+
.. _toolkit_ggplot:
143+
144+
ggplot
145+
======
146+
(*Not distributed with matplotlib*)
147+
148+
`ggplot <https://github.com/yhat/ggplot>`_ is a port of the R ggplot2
149+
to python based on matplotlib.
150+
151+
.. image:: /_static/ggplot.png
152+
:height: 195px
153+
154+
155+
.. _toolkit_prettyplotlib:
156+
157+
prettyplotlib
158+
=============
159+
(*Not distributed with matplotlib*)
160+
161+
`prettyplotlib <https://olgabot.github.io/prettyplotlib>`_ is an extension
162+
to matplotlib which changes many of the defaults to make plots some
163+
consider more attractive.
164+
165+
166+
iTerm2 terminal backend
167+
=======================
168+
(*Not distributed with matplotlib*)
169+
170+
`matplotlib_iterm2 <https://github.com/oselivanov/matplotlib_iterm2>`_ is an
171+
external matplotlib backend uses iTerm2 nightly build inline image display
172+
feature.
173+
174+
.. image:: /_static/matplotlib_iterm2_demo.png

lib/matplotlib/tests/test_contour.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from matplotlib.testing.decorators import cleanup, image_comparison
1111
from matplotlib import pyplot as plt
1212
from nose.tools import assert_equal, assert_raises
13+
from numpy.testing import assert_array_almost_equal
1314
import warnings
1415

1516
import re
@@ -314,6 +315,15 @@ def test_vminvmax_warning():
314315
assert str(w[0].message).startswith(msg)
315316

316317

318+
@cleanup
319+
def test_contourf_symmetric_locator():
320+
# github issue 7271
321+
z = np.arange(12).reshape((3, 4))
322+
locator = plt.MaxNLocator(nbins=4, symmetric=True)
323+
cs = plt.contourf(z, locator=locator)
324+
assert_array_almost_equal(cs.levels, np.linspace(-12, 12, 5))
325+
326+
317327
if __name__ == '__main__':
318328
import nose
319329
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

lib/matplotlib/ticker.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,9 +1812,13 @@ def __call__(self):
18121812
return self.tick_values(vmin, vmax)
18131813

18141814
def tick_values(self, vmin, vmax):
1815+
if self._symmetric:
1816+
vmax = max(abs(vmin), abs(vmax))
1817+
vmin = -vmax
18151818
vmin, vmax = mtransforms.nonsingular(
18161819
vmin, vmax, expander=1e-13, tiny=1e-14)
18171820
locs = self._raw_ticks(vmin, vmax)
1821+
18181822
prune = self._prune
18191823
if prune == 'lower':
18201824
locs = locs[1:]
@@ -1826,9 +1830,8 @@ def tick_values(self, vmin, vmax):
18261830

18271831
def view_limits(self, dmin, dmax):
18281832
if self._symmetric:
1829-
maxabs = max(abs(dmin), abs(dmax))
1830-
dmin = -maxabs
1831-
dmax = maxabs
1833+
dmax = max(abs(dmin), abs(dmax))
1834+
dmin = -dmax
18321835

18331836
dmin, dmax = mtransforms.nonsingular(
18341837
dmin, dmax, expander=1e-12, tiny=1e-13)

0 commit comments

Comments
 (0)
0