Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
lehrkraefte:snr:informatik:glf22:python:listen [2023/01/19 23:21] Olaf Schnürer [Weiteres Material] |
lehrkraefte:snr:informatik:glf22:python:listen [2023/01/19 23:26] Olaf Schnürer [Listen von Zahlen graphisch darstellen] |
||
---|---|---|---|
Line 540: | Line 540: | ||
<code python saeulendiagramm.py> | <code python saeulendiagramm.py> | ||
from matplotlib import pyplot | from matplotlib import pyplot | ||
- | from math import * | ||
- | xWerte = [i for i in range(-10, | + | xWerte = [i for i in range(-10, |
- | yWerte = [cos(x*x) for x in xWerte] | + | yWerte = [(x-3)*(x+2)*(x-25) for x in xWerte] |
pyplot.bar(xWerte, | pyplot.bar(xWerte, | ||
pyplot.show() | pyplot.show() | ||
Line 550: | Line 549: | ||
<code python graph.py> | <code python graph.py> | ||
from matplotlib import pyplot | from matplotlib import pyplot | ||
- | from math import * | ||
- | xWerte = [i for i in range(30)] | + | xWerte = [i for i in range(-10, 30)] |
- | yWerte = [x*sin(x**3) for x in xWerte] | + | yWerte = [(x-3)*(x+2)*(x-25) for x in xWerte] |
pyplot.plot(xWerte, | pyplot.plot(xWerte, | ||
pyplot.show() | pyplot.show() | ||
- | |||
</ | </ | ||