|
From: Yoshi R. <yo...@ro...> - 2013-09-26 15:54:07
|
Hey,
I'm trying to plot streamplots into an axesgrid object with something
like:
fig = pl.figure(1, (13, 20))
grid = AxesGrid(fig, 111,
nrows_ncols = (3, 2),
axes_pad = 0.6,
cbar_location = 'top',
cbar_mode = 'each',
cbar_size = '2%',
cbar_pad = '1%',
)
[...]
norm = mpl.colors.LogNorm(vmin=1, vmax=5000)
im = grid[i].streamplot(XPTS, YPTS, zx, zy,
color=zr,
arrowsize=.001,
norm=norm)
grid.cbar_axes[i].colorbar(im)
[...]
and then it failes with:
Traceback (most recent call last):
File "./results.py", line 96, in <module>
grid.cbar_axes[i].colorbar(im)
File
"/usr/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py",
line 85, in colorbar cb = Colorbar(self, mappable,
orientation=orientation, **kwargs) File
"/usr/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/colorbar.py",
line 706, in __init__ mappable.autoscale_None() # Ensure
mappable.norm.vmin, vmax AttributeError: 'StreamplotSet' object has no
attribute 'autoscale_None'
can't I use streamplots in axesgrid? If I comment out the colorbar for
the streamplot colors it works ...
Is this a bug? Is there a right way to do it? Is there a work around?
Many thanks in advance!
Regards, Yoshi
|