Skip to content

Commit f5d995b

Browse files
committed
Merge branch 'master' of github.com:matplotlib/matplotlib
* 'master' of github.com:matplotlib/matplotlib: (90 commits) added information regarding new spectrum functions to CHANGELOG, whats_new, and api_changes add demo for new spectral plot types add tests for new spectrum types in _axes add more spectral plots and add new spectrum types to specgram in _axes implement tests for refactored mlab spectrum, windowing, and detrend functions, with 100% coverage refactor mlab spectrum, window, and detrend functions to improve modularity, testability, and performance add CleanupTestCase, a unittest.TestCase with cleanup add mlab tests for new spectrum types, window and detrend functions, and greatly expand existing tests add more spectrum functions and add new spectrum types to specgram in mlab.py, and clean up window and detrend functions in mlab.py Fix for compiling ttconv in extern directory cast argv to unicode before testing Move external libraries to 'extern' directory Minor doc fixes Fix encoding issues when font name contains non-ascii characters Fix writing to all manner of StringIO-like objects in PS backend. add new ps backend test file in `__init__.py` BUG: Fixed object type missmatch in SymLogNorm add failing test: savefig(StringIO(), format="ps") Adding a missing 'b' back into two 'bbox_' kwargs Fix build ...
2 parents 7c486f4 + d5f9876 commit f5d995b

File tree

500 files changed

+15492
-7329
lines changed

Some content is hidden

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

500 files changed

+15492
-7329
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@ doc/_templates/gallery.html
5454
doc/users/installing.rst
5555
doc/_static/matplotlibrc
5656
lib/dateutil
57+
examples/*/*.pdf
58+
examples/*/*.png
59+
examples/tests/*
60+
!examples/tests/backend_driver.py
61+
texput.log
62+
result_images

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ python:
1717
- 3.3
1818

1919
install:
20-
- pip install -q --use-mirrors nose python-dateutil numpy pep8 pyparsing
21-
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip -q install --use-mirrors PIL; fi
20+
- pip install -q --use-mirrors nose python-dateutil numpy pep8 pyparsing pillow
2221
- sudo apt-get update && sudo apt-get -qq install inkscape
2322
- python setup.py install
2423

@@ -35,5 +34,6 @@ script:
3534
- python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300
3635

3736
after_failure:
38-
- cd ../matplotlib
39-
- ./travis_upload.sh
37+
- tar cjf result_images.tar.bz2 result_images
38+
- travis-artifacts upload --path result_images.tar.bz2
39+
- echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2

CHANGELOG

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2013-10-06 Add stride-based functions to mlab for easy creation of 2D arrays
2+
with less memory.
3+
4+
2013-10-06 Improve window and detrend functions in mlab, particulart support for
5+
2D arrays.
6+
7+
2013-10-06 Improve performance of all spectrum-related mlab functions and plots.
8+
9+
2013-10-06 Added support for magnitude, phase, and angle spectrums to
10+
axes.specgram, and support for magnitude, phase, angle, and complex
11+
spectrums to mlab-specgram.
12+
13+
2013-10-06 Added magnitude_spectrum, angle_spectrum, and phase_spectrum plots,
14+
as well as magnitude_spectrum, angle_spectrum, phase_spectrum,
15+
and complex_spectrum functions to mlab
16+
117
2013-07-12 Added support for datetime axes to 2d plots. Axis values are passed
218
through Axes.convert_xunits/Axes.convert_yunits before being used by
319
contour/contourf, pcolormesh and pcolor.

boilerplate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
# For some later history, see
1717
# http://thread.gmane.org/gmane.comp.python.matplotlib.devel/7068
1818

19-
from __future__ import absolute_import, division, print_function, unicode_literals
19+
from __future__ import (absolute_import, division, print_function,
20+
unicode_literals)
2021

2122
import six
2223

@@ -97,6 +98,7 @@ def boilerplate_gen():
9798
# name.
9899
_plotcommands = (
99100
'acorr',
101+
'angle_spectrum',
100102
'arrow',
101103
'axhline',
102104
'axhspan',
@@ -122,8 +124,10 @@ def boilerplate_gen():
122124
'hlines',
123125
'imshow',
124126
'loglog',
127+
'magnitude_spectrum',
125128
'pcolor',
126129
'pcolormesh',
130+
'phase_spectrum',
127131
'pie',
128132
'plot',
129133
'plot_date',

doc/api/api_changes.rst

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,49 @@ original location:
7676
- `xycoords` -> set the units of the point location
7777
- `set_position()` -> `Annotation` only set location of annotation
7878

79+
* NFFT being even is now enforced in `matplotlib.mlab.specgram`,
80+
`matplotlib.mlab.psd`, `matplotlib.mlab.csd`,
81+
`matplotlib.mlab.cohere`, `matplotlib.mlab.cohere_pairs`,
82+
`matplotlib.pyplot.specgram`, `matplotlib.pyplot.psd`,
83+
`matplotlib.pyplot.csd`, and `matplotlib.pyplot.cohere`. This was
84+
listed as a requirement but was not actually checked.
85+
86+
* `matplotlib.mlab.specgram`, `matplotlib.mlab.psd`, `matplotlib.mlab.csd`,
87+
`matplotlib.mlab.cohere`, `matplotlib.mlab.cohere_pairs`,
88+
`matplotlib.pyplot.specgram`, `matplotlib.pyplot.psd`,
89+
`matplotlib.pyplot.csd`, and `matplotlib.pyplot.cohere` now raise
90+
ValueError where they previously raised AssertionError.
91+
92+
* For `matplotlib.mlab.psd`, `matplotlib.mlab.csd`,
93+
`matplotlib.mlab.cohere`, `matplotlib.mlab.cohere_pairs`,
94+
`matplotlib.pyplot.specgram`, `matplotlib.pyplot.psd`,
95+
`matplotlib.pyplot.csd`, and `matplotlib.pyplot.cohere`, in cases
96+
where a shape (n, 1) array is returned, this is now converted to a (n, )
97+
array. Previously, (n, m) arrays were averaged to an (n, ) array, but
98+
(n, 1) arrays were returend unchanged. This change makes the dimensions
99+
consistent in both cases.
100+
79101

80102
.. _changes_in_1_3:
81103

82104

83105
Changes in 1.3.x
84106
================
85107

108+
Changes in 1.3.1
109+
----------------
110+
111+
It is rare that we make an API change in a bugfix release, however,
112+
for 1.3.1 since 1.3.0 the following change was made:
113+
114+
- `text.Text.cached` (used to cache font objects) has been made into a
115+
private variable. Among the obvious encapsulation benefit, this
116+
removes this confusing-looking member from the documentation.
117+
118+
- The method :meth:`~matplotlib.axes.Axes.hist` now always returns bin
119+
occupancies as an array of type `float`. Previously, it was sometimes
120+
an array of type `int`, depending on the call.
121+
86122
Code removal
87123
------------
88124

@@ -263,10 +299,6 @@ Code changes
263299
* The :func:`matplotlib.cbook.check_output` function has been moved to
264300
:func:`matplotlib.compat.subprocess`.
265301

266-
* The method :meth:`~matplotlib.axes.Axes.hist` now always returns bin
267-
occupancies as an array of type `float`. Previously, it was sometimes
268-
an array of type `int`, depending on the call.
269-
270302
Configuration and rcParams
271303
--------------------------
272304

doc/users/plotting/examples/pgf_preamble.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import, division, print_function, unicode_literals
2+
from __future__ import (absolute_import, division, print_function,
3+
unicode_literals)
34

45
import six
56

doc/users/whats_new.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,36 @@ Andrew Dawson added support for datetime axes to
3232
:func:`~matplotlib.pyplot.contour`, :func:`~matplotlib.pyplot.contourf`,
3333
:func:`~matplotlib.pyplot.pcolormesh` and :func:`~matplotlib.pyplot.pcolor`.
3434

35+
Support for additional spectrum types
36+
`````````````````````````````````````
37+
Todd Jennings added support for new types of frequency spectrum plots:
38+
:func:`~matplotlib.pyplot.magnitude_spectrum`,
39+
:func:`~matplotlib.pyplot.phase_spectrum`, and
40+
:func:`~matplotlib.pyplot.angle_spectrum`, as well as corresponding functions
41+
in mlab.
42+
43+
He also added these spectrum types to :func:`~matplotlib.pyplot.specgram`,
44+
as well as adding support for linear scaling there (in addition to the
45+
existing dB scaling). Support for additional spectrum types was also added to
46+
:func:`~matplotlib.mlab.specgram`.
47+
48+
He also increased the performance for all of these functions and plot types.
49+
50+
Support for detrending and windowing 2D arrays in mlab
51+
``````````````````````````````````````````````````````
52+
Todd Jennings added support for 2D arrays in the
53+
:func:`~matplotlib.mlab.detrend_mean`, :func:`~matplotlib.mlab.detrend_none`,
54+
and :func:`~matplotlib.mlab.detrend`, as well as adding
55+
:func:`~matplotlib.mlab.apply_window` which support windowing 2D arrays.
56+
57+
Support for strides in mlab
58+
```````````````````````````
59+
Todd Jennings added some functions to mlab to make it easier to use numpy
60+
strides to create memory-efficient 2D arrays. This includes
61+
:func:`~matplotlib.mlab.stride_repeat`, which repeats an array to create a 2D
62+
array, and :func:`~matplotlib.mlab.stride_windows`, which uses a moving window
63+
to create a 2D array from a 1D array.
64+
3565

3666
Date handling
3767
-------------
@@ -58,6 +88,74 @@ to a non-transparent background.
5888
new in matplotlib-1.3
5989
=====================
6090

91+
New in 1.3.1
92+
------------
93+
94+
1.3.1 is a bugfix release, primarily dealing with improved setup and
95+
handling of dependencies, and correcting and enhancing the
96+
documentation.
97+
98+
The following changes were made in 1.3.1 since 1.3.0.
99+
100+
Enhancements
101+
````````````
102+
103+
- Added a context manager for creating multi-page pdfs (see
104+
`matplotlib.backends.backend_pdf.PdfPages`).
105+
106+
- The WebAgg backend should now have lower latency over heterogeneous
107+
Internet connections.
108+
109+
Bug fixes
110+
`````````
111+
112+
- Histogram plots now contain the endline.
113+
114+
- Fixes to the Molleweide projection.
115+
116+
- Handling recent fonts from Microsoft and Macintosh-style fonts with
117+
non-ascii metadata is improved.
118+
119+
- Hatching of fill between plots now works correctly in the PDF
120+
backend.
121+
122+
- Tight bounding box support now works in the PGF backend.
123+
124+
- Transparent figures now display correctly in the Qt4Agg backend.
125+
126+
- Drawing lines from one subplot to another now works.
127+
128+
- Unit handling on masked arrays has been improved.
129+
130+
Setup and dependencies
131+
``````````````````````
132+
133+
- Now works with any version of pyparsing 1.5.6 or later, without displaying
134+
hundreds of warnings.
135+
136+
- Now works with 64-bit versions of Ghostscript on MS-Windows.
137+
138+
- When installing from source into an environment without Numpy, Numpy
139+
will first be downloaded and built and then used to build
140+
matplotlib.
141+
142+
- Externally installed backends are now always imported using a
143+
fully-qualified path to the module.
144+
145+
- Works with newer version of wxPython.
146+
147+
- Can now build with a PyCXX installed globally on the system from source.
148+
149+
- Better detection of Gtk3 dependencies.
150+
151+
Testing
152+
```````
153+
154+
- Tests should now work in non-English locales.
155+
156+
- PEP8 conformance tests now report on locations of issues.
157+
158+
61159
New plotting features
62160
---------------------
63161

examples/mplot3d/text3d_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
ax = fig.gca(projection='3d')
66

77
zdirs = (None, 'x', 'y', 'z', (1, 1, 0), (1, 1, 1))
8-
xs = (2, 6, 4, 9, 7, 2)
9-
ys = (6, 4, 8, 7, 2, 2)
10-
zs = (4, 2, 5, 6, 1, 7)
8+
xs = (1, 4, 4, 9, 4, 1)
9+
ys = (2, 5, 8, 10, 1, 2)
10+
zs = (10, 3, 8, 9, 1, 8)
1111

1212
for zdir, x, y, z in zip(zdirs, xs, ys, zs):
1313
label = '(%d, %d, %d), dir=%s' % (x, y, z, zdir)
1414
ax.text(x, y, z, label, zdir)
1515

16-
ax.text(1, 1, 1, "red", color='red')
16+
ax.text(9, 0, 0, "red", color='red')
1717
ax.text2D(0.05, 0.95, "2D Text", transform=ax.transAxes)
1818

1919
ax.set_xlim3d(0, 10)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python
2+
# python
3+
4+
from pylab import *
5+
6+
dt = 0.01
7+
Fs = 1/dt
8+
t = arange(0, 10, dt)
9+
nse = randn(len(t))
10+
r = exp(-t/0.05)
11+
12+
cnse = convolve(nse, r)*dt
13+
cnse = cnse[:len(t)]
14+
s = 0.1*sin(2*pi*t) + cnse
15+
16+
subplot(3, 2, 1)
17+
plot(t, s)
18+
19+
subplot(3, 2, 3)
20+
magnitude_spectrum(s, Fs=Fs)
21+
22+
subplot(3, 2, 4)
23+
magnitude_spectrum(s, Fs=Fs, scale='dB')
24+
25+
subplot(3, 2, 5)
26+
angle_spectrum(s, Fs=Fs)
27+
28+
subplot(3, 2, 6)
29+
phase_spectrum(s, Fs=Fs)
30+
31+
show()

examples/shapes_and_collections/scatter_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
N = 50
99
x = np.random.rand(N)
1010
y = np.random.rand(N)
11+
colors = np.random.rand(N)
1112
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radiuses
1213

13-
plt.scatter(x, y, s=area, alpha=0.5)
14+
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
1415
plt.show()

0 commit comments

Comments
 (0)