plotting in a loop

Thank you very much Steve! This helped a lot, it worked in the ipython as well, there is no difference, only that the ipython is interactive and has more supplementary features. :slight_smile:

Thanks,

Tomislav

路路路

tomislav_maric@鈥2537鈥

Hello everyone,

if I read a column file like this (simplified to integers):

0 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6

with: 鈥渄ata = np.loadtxt(鈥渇ileName鈥)鈥, why can鈥檛 I use a for loop inside ipython (started with 鈥-pylab鈥 option) to plot each of the Line2D objects and then draw them on the plot? I am using matplotlib to debug a computational geometry code and I would like these lines to plot paused by the user input so that I can identify when (where) exactly the wrong calculations happen:

import numpy as np

import matplotlib.pyplot as plt

fig1 = plt.figure()

ax1 = fig1.add_subplot(111)

ax1.set_aspect(鈥渆qual鈥)

for line in data:

raw_input(鈥減ress enter to plot the line鈥)

ax1.plot([line[0],line[2]],[line[1],line[3]],鈥榖鈥)

plt.draw()

This way I could see with pressing e.g. the return key when my calculations go wrong鈥 any advice?


------------------------------------------------------------------------------ Download Intel庐 Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. _______________________________________________ Matplotlib-users mailing list
http://p.sf.net/sfu/intel-sw-dev


Matplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users