On Mon, Feb 7, 2011 at 5:02 AM, Paul Leopardi <paul.leopardi@iinet.net.au> wrote:
Hi all,
On Sun, 6 Feb 2011 03:54:48 PM Paul Leopardi wrote:
> I'm having trouble using multiple figures with mplot3d.

I have appended an entire example script, below.

The script incrementally plots 3 curves, one in each of 3 figure windows. The
trouble is, once Figure 2 has finished plotting, the curve for Figure 1
disappears and is replaced by the curve for Figure 2, with the axes for Figure
1; once Figure 3 has finished plotting, the curves for Figures 1 and 2
disappear and are replaced by the curve for Figure 3, with the axes for Figure
1 and Figure 2, respectively.

The original code was written with incremental plotting because the points
took a long time to calculate. Without incremental plotting, the figures
stayed blank for a long time. The script below is very similar to my original
script, but does not depend on my GluCat library.

Best, Paul

# -*- coding: utf-8 -*-

# Imports needed for array calculation and plotting.
from numpy import array, floor, random, empty, cos, pi
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

# Constants to control the plotting.
C=3 # Number of curves to plot.
P=1000 # Number of points overall.
R=2 # Scaling constant to use.
N=25 # Number of points in a curve segment.

# Array of points.

# Plot C curves.
for i in xrange(0,C):
 # Initial point.

 # Plot a curve using a random bivector in R_{5,0}
 # with appropriate scaling.
 w=random.randn(3) * 2*pi*R/P

 # Use a new figure for each curve.
 # ax=Axes3D(fig)
 ax = fig.gca(projection='3d')

 # Coordinate limits to determine the colour of the first curve segment.

 # Split the curve into M segments, each with an appropriate colour.
 for j in range(0,M):

 # Find N points forming a curve segment by
 # exponentiating w*k for k from j*N to (j+1)*N-1.
 for k in xrange(abot,atop):
  for h in range(0,3):

 # Determine the colour of the curve segment.
 for h in range(0,3):

 # Plot the curve segment using the chosen colour.
 alow=(abot-1 if j>0 else abot)


As formatted, the code would not run.  I presume that everything after "for j in range(0,M):" should be indented?  When I did that and ran it in ipython, I could not reproduce your problem.  What version of matplotlib are you running?

Ben Root