Re: [Matplotlib-users] Plotting in loop problem, not refreshing
I am using MPL 1.0.1 with Python 2.6 over Windows XP and it works. I would like to add an advice: range(n) creates a list of size n, and stores it in memory. But in your code you are only using one number at a time. Python has a better instruction: xrange. It works exactly like range, but doesn't create the list; it will return sequentially every number without the need of storing all at once. In this simple program it makes no difference, but when you go bigger, it will. David. On Sun, Jun 5, 2011 at 3:28 AM, Joe Kington wrote: > Your code should work (and does on my system)... > What backend, version of matplotlib, OS, etc are you running? > > On Sat, Jun 4, 2011 at 4:54 PM, Armin G wrote: >> >> Hi everyone , >> >> I know this has been posted several times now, But I could not understand >> qietly why my simple code does not work. >> here is the code: >> http://old.nabble.com/file/p31775254/LinearConvection.py >> LinearConvection.py >> >> The problem in detail: In the solver loop ( the outer loop) , The plot >> should be updated after every time step, but it stays the same. >> >> I'm a complete noob in python, so excuse my simple communicating language. >> >> thanks alot, >> Armin >> -- >> View this message in context: >> http://old.nabble.com/Plotting-in-loop-problem%2C-not-refreshing-tp31775254p31775254.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> >> -- >> Simplify data backup and recovery for your virtual environment with >> vRanger. >> Installation's a snap, and flexible recovery options mean your data is >> safe, >> secure and there when you need it. Discover what all the cheering's about. >> Get your free trial download today. >> http://p.sf.net/sfu/quest-dev2dev2 >> ___ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > -- > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] fixing figure size on wxpython app
Hi all, I'm developing an app for structural geology called OenStereo ( www.igc.usp.br/openstereo), using matplotlib and wxpython. So far, I'm really happy with the results, but there is still one thing annoying me: when I save the plots (using the save icon in the NavigationToolbar), the resulting figure size is determined by the size of the window. Can I set this to a fixed value (like 15cm)? this is a part of the code where I create the figure: #initialize the figure and canvas self.stereoFigure = Figure(figsize=(4,4),facecolor='white') self.stereoCanvas = FigureCanvas(self, -1, self.stereoFigure) self.toolbar = VMToolbar(self.stereoCanvas) self.stereoCanvas.mpl_connect("motion_notify_event", self.OnMove) #initialize the plot area self.plotaxes = self.stereoFigure.add_axes([0.01, 0.01, 0.6, 0.98], clip_on='True',xlim=(-1.1,1.2), ylim=(-1.15,1.15), adjustable='box',autoscale_on='False',label='stereo') self.plotaxes.set_axis_off() self.plotaxes.set_aspect(aspect='equal', adjustable=None, anchor='W') best Carlos -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano http://lattes.cnpq.br/5846052449613692 Linux User #89721 Can’t stop the signal. -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] problems saving as pdf in Snow Leopard using python 2.7.1 from python.org
Hi, I am running matplotlib 1.0.0 on python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) in snow leopard from python.org and I have come across a problem saving pdf files. Trying the simple script: import matplotlib.pyplot as pt pt.plot([1, 2, 3]) pt.savefig("figure.pdf") Causes a bus error and a python crash. There is a previous thread in the list that suggests that the problem is not matplotlib related. However, that thread refers to EPD, which is not my case. The apparent solution in that thread was deleting DYLD_LIBRARY_PATH from .profile (don't understand why), but I don't have such environment variable defined. Has anyone come across anything like that? Many thanks! Angel -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users