3D subfigures in matplotlib?

2011-04-05 Thread MATLABdude
How can I make maybe 3D subfigures with Python and matplotlib? I found the following example (http://matplotlib.sourceforge.net/ examples/mplot3d/subplot3d_demo.html), but it doesn't work. --- from mpl_toolkits.mplot3d.axes3d import Axes3D import matplotlib.pyplot as plt # imports specific to th

MATLAB to Python?

2010-11-17 Thread MATLABdude
Hi! Can you, please, try to help me with Python? I try to convert a MATLAB program to Python. Here are the MATLAB codes: http://pastebin.com/eJetYizv http://pastebin.com/0eXTVfyN Here is my Python code: http://pastebin.com/jCPdLHx7 What is wrong with my Python code? The program doesn't produce

Re: MATLAB to Python?

2010-11-18 Thread MATLABdude
On Nov 17, 10:04 am, MATLABdude wrote: Thanks guys! I still have some problems. I made the code somewhat simpler by dropping off some parts of it (xx, f). Now my Python code calculates 8 different values for lambda. The problem is that I don't know where the minus sign comes from. Als

Re: MATLAB to Python?

2010-11-22 Thread MATLABdude
On Nov 17, 10:53 am, Arnaud Delobelle wrote: > I guess that the step is supposed to be h, so you should write: >     xx = range(-kappa, kappa+1, h) This is what I have in the source code: ---8<---8<---8<---8<--- h = 0.105069988414 xx = range(-kappa, kappa+1, h) ---8<---8<---8<---8<--- This is w

Re: MATLAB to Python?

2010-11-22 Thread MATLABdude
On Nov 22, 11:11 am, Peter Otten <__pete...@web.de> wrote: > Try numpy.arange() instead: > >>> numpy.arange(0, 1, .1) > array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9]) Thanks! It worked. What's wrong with the following code? ---8<---8<---8<--- T0_orig = [5, 50, 500, 5000]

Re: MATLAB to Python?

2010-11-22 Thread MATLABdude
On Nov 23, 9:43 am, Arnaud Delobelle wrote: > T0_orig is a list and you are trying to multiply this list by a float > (m**-1) Yes, yes of course. Thanks! :) This works: ---8<---8<---8<--- T0_orig = [5, 50, 500, 5000] for counter in T0_orig: T0 = (L**2)/(D*pi**2)*counter a