Permalink
Browse files

Rebased and updated tests.

  • Loading branch information...
1 parent 6dde4c1 commit da8827164b5d7664e0efb1fee8995769f5cfe32d @pelson committed Mar 13, 2013
View
@@ -267,6 +267,7 @@ def __init__(self, ax, cmap=None,
filled=True,
extendfrac=None,
extendrect=False,
+ label='',
):
self.ax = ax
self._patch_ax()
@@ -352,7 +353,6 @@ def config_axis(self):
ax.yaxis.set_ticks([])
# location is either one of 'left' or 'right'
ax.xaxis.set_label_position(self.ticklocation)
- # XXX This wasn't enabled before...
ax.xaxis.set_ticks_position(self.ticklocation)
self._set_label()
@@ -1228,11 +1228,8 @@ def _add_solids(self, X, Y, C):
patch = mpatches.PathPatch(mpath.Path(xy),
facecolor=self.cmap(self.norm(val)),
- hatch=hatch,
- edgecolor='none', linewidth=0,
- antialiased=False, **kw
- )
-
+ hatch=hatch, linewidth=0,
+ antialiased=False, **kw)
self.ax.add_patch(patch)
patches.append(patch)
@@ -1247,12 +1244,9 @@ def _add_solids(self, X, Y, C):
self.dividers = None
if self.drawedges:
- self.dividers = collections.LineCollection(
- self._edges(X, Y),
- colors=(mpl.rcParams['axes.edgecolor'],),
- linewidths=(
- 0.5 * mpl.rcParams['axes.linewidth'],)
- )
+ self.dividers = collections.LineCollection(self._edges(X, Y),
+ colors=(mpl.rcParams['axes.edgecolor'],),
+ linewidths=(0.5 * mpl.rcParams['axes.linewidth'],))
self.ax.add_collection(self.dividers)
self.ax.hold(_hold)
View
@@ -1418,7 +1418,7 @@ def savefig(self, *args, **kwargs):
ax.patch.set_edgecolor(cc[1])
@docstring.dedent_interpd
- def colorbar(self, mappable, cax=None, ax=None, use_gridspec=False, **kw):
+ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw):
"""
Create a colorbar for a ScalarMappable instance, *mappable*.
@@ -1428,6 +1428,9 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=False, **kw):
if ax is None:
ax = self.gca()
+ # Store the value of gca so that we can set it back later on.
+ current_ax = self.gca()
+
if cax is None:
if use_gridspec and isinstance(ax, SubplotBase):
cax, kw = cbar.make_axes_gridspec(ax, **kw)
@@ -1436,7 +1439,7 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=False, **kw):
cax.hold(True)
cb = cbar.colorbar_factory(cax, mappable, **kw)
- self.sca(ax)
+ self.sca(current_ax)
return cb
def subplots_adjust(self, *args, **kwargs):
View
@@ -209,7 +209,6 @@ def rc_context(rc=None, fname=None):
return matplotlib.rc_context(rc, fname)
-
@docstring.copy_dedent(matplotlib.rcdefaults)
def rcdefaults():
matplotlib.rcdefaults()
@@ -303,8 +302,8 @@ def xkcd():
raise
return context
-## Figures ##
+## Figures ##
def figure(num=None, # autoincrement if None, else integer from 1-N
figsize=None, # defaults to rc figure.figsize
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit da88271

Please sign in to comment.