Mehrere Plots in einer Figure
Verfasst: Sonntag 10. Mai 2015, 19:46
Hallo liebe Forumsgemeinde,
als blutiger Anfänger habe ich versucht folgendes kurzes Matlabscript,
in Pythoncode umzuwandeln.
Sicher strotzt der Versuch nur so vor Unzulänglichkeiten. Am gravierendsten für mich ist allerdings, dass die einzelnen Plots nicht wie im Matlabbeispiel in einer "figure" dargestellt werden bzw. auch mit der errorfunction anscheinend etwas nicht stimmt. Für Hilfe zu diesem Problem und auch bzgl. anderer problematischer Dinge wäre ich sehr dankbar.
als blutiger Anfänger habe ich versucht folgendes kurzes Matlabscript,
Code: Alles auswählen
x=(0:0.1:5);
w = 2;
s = 20;
zet = linspace(0.2,10,6);
figure(1)
for s=zet
n = 2-erf(x/(2*(w*s)^(1/2)));
plot(x,n)
hold on
xlabel('x');
ylabel('y')
end
Code: Alles auswählen
# -*- coding: utf-8 -*-
import numpy as np
import pylab as pl
from math import erf
x = np.arange(0,5,0.1)
zet = np.linspace(0.2,10,6)
w = 2
s = 20
for s in zet:
np_erf = np.vectorize(erf)
e = 2-np_erf(x/(2*(w*s)**(1/2)))
pl.figure()
pl.hold(True)
pl.plot(x,e)
pl.xlabel('x')
pl.ylabel('y')
pl.show()