Browse files

Added documentation of patch/alpha changes.

  • Loading branch information...
Westacular committed May 4, 2013
1 parent a7f7cc7 commit cd186451f846100d7c93520b3b28549e155256e1
Showing with 26 additions and 2 deletions.
  1. +15 −0 doc/api/api_changes.rst
  2. +10 −0 doc/users/whats_new.rst
  3. +1 −2 lib/matplotlib/
@@ -43,6 +43,21 @@ Changes in 1.3.x
* The :func:`~matplotlib.cbook.check_output` function has been moved to
+* :class:`~matplotlib.patches.Patch` now fully supports using RGBA values for
+ its ``facecolor`` and ``edgecolor`` attributes, which enables faces and
+ edges to have different alpha values. If the
+ :class:`~matplotlib.patches.Patch` object's ``alpha`` attribute is set to
+ anything other than ``None``, that value will override any alpha-channel
+ value in both the face and edge colors. Previously, if
+ :class:`~matplotlib.patches.Patch` had ``alpha=None``, the alpha component
+ of ``edgecolor`` would be applied to both the edge and face.
+* For :class:`~matplotlib.patches.Patch`, the ``capstyle`` used is now
+ ``butt``, to be consistent with the default for most other objects, and to
+ avoid problems with non-solid ``linestyle`` appearing solid when using a
+ large ``linewidth``. Previously, :class:`~matplotlib.patches.Patch` used
+ ``capstyle='projecting'``.
Changes in 1.2.x
@@ -154,6 +154,16 @@ Wes Campaigne and Phil Elson fixed the Agg backend such that PNGs are now
saved with the correct background color when :meth:`fig.patch.get_alpha` is
not 1.
+Independent alpha values for face and edge colors
+Wes Campaigne modified how :class:`~matplotlib.patches.Patch` objects are
+drawn such that (for backends supporting transparency) you can set different
+alpha values for faces and edges, by specifying their colors in RGBA format.
+Note that if you set the alpha attribute for the patch object (e.g. using
+:meth:`~matplotlib.patches.Patch.set_alpha` or the ``alpha`` keyword
+argument), that value will override the alpha components set in both the
+face and edge colors.
.. _whats-new-1-2-2:
@@ -901,8 +901,7 @@ def set_foreground(self, fg, isRGBA=False):
html hex color string, an rgb or rgba unit tuple, or a float between 0
and 1. In the latter case, grayscale is used.
- If you know fg is rgb or rgba, set ``isRGBA=True`` for
- efficiency.
+ If you know fg is rgba, set ``isRGBA=True`` for efficiency.
self._orig_color = fg
if self._forced_alpha:

0 comments on commit cd18645

Please sign in to comment.