Hi all,
I'm having trouble using multiple figures with mplot3d. Once each new figure
is plotted, the plots from new figure is also displayed in all of the old
figures. For example, once the plot for figure 2 has finished, the plot fo
figure 1 is replaced by a copy of the plot for figure 2, and so on...
I have included an abbreviated version of my script code. My original code
uses Cython and my GluCat library, but I am fairly sure the cause of the
problem lies either with mplot3d or with my Python script code.
I am using openSUSE 11.2 with
python-base-2.6.2-6.7.1.x86_64
python-matplotlib-1.0.1-20.1.x86_64
python-matplotlib-tk-1.0.1-20.1.x86_64
python-matplotlib-wx-1.0.1-20.1.x86_64
Best, Paul
Script excerpt:
...
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
...
# Plot C curves.
for i in xrange(0,C):
...
# Use a new figure for each curve.
fig=plt.figure(figsize=(15,12))
ax = fig.gca(projection='3d')
plt.show()
...
# Split the curve into M segments, each with an appropriate colour.
for j in range(0,M):
# Find N points forming a curve segment ...
# Determine the colour of the curve segment...
# Plot the curve segment using the chosen colour.
alow=(abot-1 if j>0 else abot)
ax.plot(x[0,alow:atop],x[1,alow:atop],x[2,alow:atop],c=rgb.tolist())
plt.draw()
plt.show()