Thanks,

that works like a charm.

final bonus question: How can i individually set the point of view/zoom level
for the different 3d subplots?

Currently, when i rotate/zoom (with the mouse) in one subplot, the changes
are applied on all 3d subplots.

Thanks again,
q

On Mon, Sep 28, 2009 at 11:52:08PM -0400, Jae-Joon Lee wrote:
> Try below instead of Axes3D. Obviously, "131" is the geometry
> parameter for subplot command. You don't need to add  "ax" to "fig"
> since Axes3D do that by itself.
> 
> from matplotlib.axes import subplot_class_factory
> Subplot3D = subplot_class_factory(Axes3D)
> 
> ax = Subplot3D(fig, 131)
> 
> This will show you the title also. However, the 3d axes will occupy
> smaller area than the area of the subplot.
> 
> Regards,
> 
> -JJ
> 
> 
> On Mon, Sep 28, 2009 at 6:23 PM,  <qu...@gmx.at> wrote:
> > Greetings,
> >
> > I would like to plot to make a figure with 3 subplots
> > of the form (221) to (223):
> >  - each subplot should show a bar3d plot of a matrix
> >  - each subplot should have it's own title
> >
> > The problems:
> >  a) I don't see (nor did i find something) how i can
> >    use subplots combined with bar3d (from the mpl_toolkits.mplot3d)
> >    package.
> >
> >  b) I don't manage to give the 3d bar plot a title. In the attached
> >    code you will see that a title is set, but it does not show
> >    up in the figure
> >
> > Could someone please help me out with these problems?
> >
> > Thanks,
> > q
> >
> > ---------------------
> >
> > The code for the basic plot of the matrix:
> >
> >
> > from mpl_toolkits.mplot3d import Axes3D
> > import matplotlib.pyplot as plt
> > from matplotlib.ticker import FixedFormatter, LinearLocator, FixedLocator
> > from numpy import *
> >
> > psi=1/sqrt(2)*array([1, 0, 0, 1])
> > rho=outer(psi,psi)
> >
> > fig = plt.figure()
> >
> > ax = Axes3D(fig)
> >
> > elements = (len(rho) * len(rho))
> > xpos, ypos = meshgrid(array(range(len(rho)))+0.25, 
> > array(range(len(rho)))+0.25)
> >
> > xpos = xpos.flatten()
> > ypos = ypos.flatten()
> > zpos = zeros(elements)
> >
> > dx = 0.5 * ones_like(zpos)
> > dy = dx.copy()
> > dz = absolute(rho.flatten())
> >
> > ax.set_title('absolute')
> >
> > ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='#F8F800')
> >
> > plt.show()
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> > is the only developer event you need to attend this year. Jumpstart your
> > developing skills, take BlackBerry mobile applications to market and stay
> > ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> > http://p.sf.net/sfu/devconf
> > _______________________________________________
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >

-- 
The king who needs to remind his people of his rank, is no king.

To gain that which is worth having, it may be necessary to lose everything else.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to