Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v1.3.x'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/matplotlib/text.py
	setup.py
  • Loading branch information
mdboom committed Sep 27, 2013
2 parents febea19 + e4ec9d5 commit 518afd8
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ doc/_templates/gallery.html
doc/users/installing.rst
doc/_static/matplotlibrc
lib/dateutil
examples/*/*.pdf
examples/*/*.png
examples/tests/*
!examples/tests/backend_driver.py
texput.log
result_images
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ script:
- python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300

after_failure:
- cd ../matplotlib
- tar cjf result_images.tar.bz2 result_images
- travis-artifacts upload --path result_images.tar.bz2
- echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2
18 changes: 14 additions & 4 deletions doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ original location:
Changes in 1.3.x
================

Changes in 1.3.1
----------------

It is rare that we make an API change in a bugfix release, however,
for 1.3.1 since 1.3.0 the following change was made:

- `text.Text.cached` (used to cache font objects) has been made into a
private variable. Among the obvious encapsulation benefit, this
removes this confusing-looking member from the documentation.

- The method :meth:`~matplotlib.axes.Axes.hist` now always returns bin
occupancies as an array of type `float`. Previously, it was sometimes
an array of type `int`, depending on the call.

Code removal
------------

Expand Down Expand Up @@ -263,10 +277,6 @@ Code changes
* The :func:`matplotlib.cbook.check_output` function has been moved to
:func:`matplotlib.compat.subprocess`.

* The method :meth:`~matplotlib.axes.Axes.hist` now always returns bin
occupancies as an array of type `float`. Previously, it was sometimes
an array of type `int`, depending on the call.

Configuration and rcParams
--------------------------

Expand Down
68 changes: 68 additions & 0 deletions doc/users/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,74 @@ to a non-transparent background.
new in matplotlib-1.3
=====================

New in 1.3.1
------------

1.3.1 is a bugfix release, primarily dealing with improved setup and
handling of dependencies, and correcting and enhancing the
documentation.

The following changes were made in 1.3.1 since 1.3.0.

Enhancements
````````````

- Added a context manager for creating multi-page pdfs (see
`matplotlib.backends.backend_pdf.PdfPages`).

- The WebAgg backend should no have lower latency over heterogeneous
Internet connections.

Bug fixes
`````````

- Histogram plots now contain the endline.

- Fixes to the Molleweide projection.

- Handling recent fonts from Microsoft and Macintosh-style fonts with
non-ascii metadata is improved.

- Hatching of fill between plots now works correctly in the PDF
backend.

- Tight bounding box support now works in the PGF backend.

- Transparent figures now display correctly in the Qt4Agg backend.

- Drawing lines from one subplot to another now works.

- Unit handling on masked arrays has been improved.

Setup and dependencies
``````````````````````

- Now works with any version of pyparsing 1.5.6 or later, without displaying
hundreds of warnings.

- Now works with 64-bit versions of Ghostscript on MS-Windows.

- When installing from source into an environment without Numpy, Numpy
will first be downloaded and built and then used to build
matplotlib.

- Externally installed backends are now always imported using a
fully-qualified path to the module.

- Works with newer version of wxPython.

- Can now build with a PyCXX installed globally on the system from source.

- Better detection of Gtk3 dependencies.

Testing
```````

- Tests should now work in non-English locales.

- PEP8 conformance tests now report on locations of issues.


New plotting features
---------------------

Expand Down
6 changes: 6 additions & 0 deletions lib/matplotlib/backends/backend_qt4agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@ def paintEvent(self, e):

refcnt = sys.getrefcount(stringBuffer)

# convert the Agg rendered image -> qImage
qImage = QtGui.QImage(stringBuffer, self.renderer.width,
self.renderer.height,
QtGui.QImage.Format_ARGB32)
# get the rectangle for the image
rect = qImage.rect()
p = QtGui.QPainter(self)
# reset the image area of the canvas to be the back-ground color
p.eraseRect(rect)
# draw the rendered image on to the canvas
p.drawPixmap(QtCore.QPoint(0, 0), QtGui.QPixmap.fromImage(qImage))

# draw the zoom rectangle to the QPainter
Expand Down
10 changes: 5 additions & 5 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,10 +906,10 @@ def __call__(self, value, clip=None):

self.autoscale_None(result)
vmin, vmax = self.vmin, self.vmax
if vmin > vmax:
raise ValueError("minvalue must be less than or equal to maxvalue")
elif vmin == vmax:
if vmin == vmax:
result.fill(0) # Or should it be all masked? Or 0.5?
elif vmin > vmax:
raise ValueError("minvalue must be less than or equal to maxvalue")
else:
vmin = float(vmin)
vmax = float(vmax)
Expand Down Expand Up @@ -947,9 +947,9 @@ def autoscale(self, A):

def autoscale_None(self, A):
' autoscale only None-valued vmin or vmax'
if self.vmin is None:
if self.vmin is None and np.size(A) > 0:
self.vmin = ma.min(A)
if self.vmax is None:
if self.vmax is None and np.size(A) > 0:
self.vmax = ma.max(A)

def scaled(self):
Expand Down
10 changes: 9 additions & 1 deletion lib/matplotlib/tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import matplotlib.colors as mcolors
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison
from matplotlib.testing.decorators import image_comparison, cleanup


def test_colormap_endian():
Expand Down Expand Up @@ -179,6 +179,14 @@ def test_cmap_and_norm_from_levels_and_colors2():
assert_raises(ValueError, mcolors.from_levels_and_colors, levels, colors)


@cleanup
def test_autoscale_masked():
# Test for #2336. Previously fully masked data would trigger a ValueError.
data = np.ma.masked_all((12, 20))
plt.pcolor(data)
plt.draw()


if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
8 changes: 4 additions & 4 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Text(Artist):
"""
zorder = 3

cached = maxdict(50)
_cached = maxdict(50)

def __str__(self):
return "Text(%g,%g,%s)" % (self._x, self._y, repr(self._text))
Expand Down Expand Up @@ -290,8 +290,8 @@ def _get_layout(self, renderer):
of a rotated text when necessary.
"""
key = self.get_prop_tup()
if key in self.cached:
return self.cached[key]
if key in self._cached:
return self._cached[key]

horizLayout = []

Expand Down Expand Up @@ -445,7 +445,7 @@ def get_text_width_height_descent(*kl, **kwargs):
xs, ys = xys[:, 0], xys[:, 1]

ret = bbox, list(zip(lines, whs, xs, ys)), descent
self.cached[key] = ret
self._cached[key] = ret
return ret

def set_bbox(self, rectprops):
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@
mod.extra_compile_args.append('-DVERBOSE')


extra_args = {}

# Finally, pass this all along to distutils to do the heavy lifting.
distrib = setup(
name="matplotlib",
Expand Down Expand Up @@ -240,4 +242,6 @@
# Telling setuptools this prevents it from doing an automatic
# check for zip safety.
zip_safe=False,

**extra_args
)

0 comments on commit 518afd8

Please sign in to comment.