Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67eb32b

Browse files
authored
Merge branch 'master' into doc-figure
2 parents83b11dd +433afcf commit67eb32b

File tree

43 files changed

+702
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+702
-319
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ result_images
8080

8181
# Nose/Pytest generated files #
8282
###############################
83+
.pytest_cache/
8384
.cache/
8485
.coverage
8586
.coverage.*

‎.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ addons:
3737
-texlive-latex-extra
3838
-texlive-latex-recommended
3939
-texlive-xetex
40+
-texlive-luatex
4041

4142
env:
4243
global:

‎doc/faq/howto_faq.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ Finally, the multipage pdf object has to be closed::
136136

137137
pp.close()
138138

139+
The same can be done using the pgf backend::
140+
141+
from matplotlib.backends.backend_pgf import PdfPages
142+
139143

140144
.. _howto-subplots-adjust:
141145

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Multipage PDF support for pgf backend
2+
-------------------------------------
3+
4+
The pgf backend now also supports multipage PDF files.
5+
6+
..code-block::python
7+
8+
from matplotlib.backends.backend_pgfimport PdfPages
9+
import matplotlib.pyplotas plt
10+
11+
with PdfPages('multipage.pdf')as pdf:
12+
# page 1
13+
plt.plot([2,1,3])
14+
pdf.savefig()
15+
16+
# page 2
17+
plt.cla()
18+
plt.plot([3,1,2])
19+
pdf.savefig()

‎doc/users/whats_new.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ revision, see the :ref:`github-stats`.
1414
..
1515
For a release, add a new section after this, then comment out the include
1616
and toctree below by indenting them. Uncomment them after the release.
17-
.. include:: next_whats_new/README.rst
18-
.. toctree::
19-
:glob:
20-
:maxdepth: 1
17+
..include::next_whats_new/README.rst
18+
..toctree::
19+
:glob:
20+
:maxdepth:1
2121

22-
next_whats_new/*
22+
next_whats_new/*
2323

2424

2525
New in Matplotlib 2.2

‎examples/misc/multipage_pdf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
66
This is a demo of creating a pdf file with several pages,
77
as well as adding metadata and annotations to pdf files.
8+
9+
If you want to use a multipage pdf file using LaTeX, you need
10+
to use `from matplotlib.backends.backend_pgf import PdfPages`.
11+
This version however does not support `attach_note`.
812
"""
913

1014
importdatetime

‎lib/matplotlib/artist.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,13 +1463,9 @@ def setp(obj, *args, **kwargs):
14631463
raiseValueError('The set args must be string, value pairs')
14641464

14651465
# put args into ordereddict to maintain order
1466-
funcvals=OrderedDict()
1467-
foriinrange(0,len(args)-1,2):
1468-
funcvals[args[i]]=args[i+1]
1469-
1470-
ret= [o.update(funcvals)foroinobjs]
1471-
ret.extend([o.set(**kwargs)foroinobjs])
1472-
return [xforxincbook.flatten(ret)]
1466+
funcvals=OrderedDict((k,v)fork,vinzip(args[::2],args[1::2]))
1467+
ret= [o.update(funcvals)foroinobjs]+ [o.set(**kwargs)foroinobjs]
1468+
returnlist(cbook.flatten(ret))
14731469

14741470

14751471
defkwdoc(a):

‎lib/matplotlib/axes/_axes.py

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,39 +2190,17 @@ def bar(self, *args, **kwargs):
21902190
adjust_xlim=True
21912191
x=0
21922192

2193-
x,height,width,y,linewidth=np.broadcast_arrays(
2194-
# Make args iterable too.
2195-
np.atleast_1d(x),height,width,y,linewidth)
2196-
21972193
iforientation=='vertical':
21982194
self._process_unit_info(xdata=x,ydata=height,kwargs=kwargs)
21992195
iflog:
22002196
self.set_yscale('log',nonposy='clip')
2201-
2202-
tick_label_axis=self.xaxis
2203-
tick_label_position=x
22042197
eliforientation=='horizontal':
22052198
self._process_unit_info(xdata=width,ydata=y,kwargs=kwargs)
22062199
iflog:
22072200
self.set_xscale('log',nonposx='clip')
2208-
2209-
tick_label_axis=self.yaxis
2210-
tick_label_position=y
22112201
else:
22122202
raiseValueError('invalid orientation: %s'%orientation)
22132203

2214-
linewidth=itertools.cycle(np.atleast_1d(linewidth))
2215-
color=itertools.chain(itertools.cycle(mcolors.to_rgba_array(color)),
2216-
# Fallback if color == "none".
2217-
itertools.repeat([0,0,0,0]))
2218-
ifedgecolorisNone:
2219-
edgecolor=itertools.repeat(None)
2220-
else:
2221-
edgecolor=itertools.chain(
2222-
itertools.cycle(mcolors.to_rgba_array(edgecolor)),
2223-
# Fallback if edgecolor == "none".
2224-
itertools.repeat([0,0,0,0]))
2225-
22262204
# lets do some conversions now since some types cannot be
22272205
# subtracted uniformly
22282206
ifself.xaxisisnotNone:
@@ -2237,6 +2215,30 @@ def bar(self, *args, **kwargs):
22372215
ifyerrisnotNone:
22382216
yerr=self.convert_yunits(yerr)
22392217

2218+
x,height,width,y,linewidth=np.broadcast_arrays(
2219+
# Make args iterable too.
2220+
np.atleast_1d(x),height,width,y,linewidth)
2221+
2222+
# Now that units have been converted, set the tick locations.
2223+
iforientation=='vertical':
2224+
tick_label_axis=self.xaxis
2225+
tick_label_position=x
2226+
eliforientation=='horizontal':
2227+
tick_label_axis=self.yaxis
2228+
tick_label_position=y
2229+
2230+
linewidth=itertools.cycle(np.atleast_1d(linewidth))
2231+
color=itertools.chain(itertools.cycle(mcolors.to_rgba_array(color)),
2232+
# Fallback if color == "none".
2233+
itertools.repeat([0,0,0,0]))
2234+
ifedgecolorisNone:
2235+
edgecolor=itertools.repeat(None)
2236+
else:
2237+
edgecolor=itertools.chain(
2238+
itertools.cycle(mcolors.to_rgba_array(edgecolor)),
2239+
# Fallback if edgecolor == "none".
2240+
itertools.repeat([0,0,0,0]))
2241+
22402242
# We will now resolve the alignment and really have
22412243
# left, bottom, width, height vectors
22422244
ifalign=='center':

‎lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,8 @@ def _gen_axes_spines(self, locations=None, offset=0.0, units='inches'):
988988
Intended to be overridden by new projection types.
989989
990990
"""
991-
returnOrderedDict([
992-
('left',mspines.Spine.linear_spine(self,'left')),
993-
('right',mspines.Spine.linear_spine(self,'right')),
994-
('bottom',mspines.Spine.linear_spine(self,'bottom')),
995-
('top',mspines.Spine.linear_spine(self,'top'))])
991+
returnOrderedDict((side,mspines.Spine.linear_spine(self,side))
992+
forsidein ['left','right','bottom','top'])
996993

997994
defcla(self):
998995
"""Clear the current axes."""

‎lib/matplotlib/axes/_subplots.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ def _make_twin_axes(self, *kl, **kwargs):
173173
"""
174174
frommatplotlib.projectionsimportprocess_projection_requirements
175175
if'sharex'inkwargsand'sharey'inkwargs:
176-
raiseValueError("Twinned Axes may share only one axis.")
176+
# The following line is added in v2.2 to avoid breaking Seaborn,
177+
# which currently uses this internal API.
178+
ifkwargs["sharex"]isnotselfandkwargs["sharey"]isnotself:
179+
raiseValueError("Twinned Axes may share only one axis.")
177180
kl= (self.get_subplotspec(),)+kl
178181
projection_class,kwargs,key=process_projection_requirements(
179182
self.figure,*kl,**kwargs)

‎lib/matplotlib/backends/_gtk3_compat.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
Thus, to force usage of PGI when both bindings are installed, import it first.
1212
"""
1313

14-
from __future__import (absolute_import,division,print_function,
15-
unicode_literals)
16-
17-
importsix
18-
1914
importimportlib
2015
importsys
2116

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp