aufgabenblatt_5_3.py created
This commit is contained in:
parent
5947f09e84
commit
6a266ebee1
28
aufgabenblatt_5_3.py
Normal file
28
aufgabenblatt_5_3.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#%%
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import matplotlib as mpl
|
||||||
|
|
||||||
|
# Konfigurieren
|
||||||
|
mpl.rcParams["font.size"] = 20
|
||||||
|
mpl.rcParams["font.family"] = "serif"
|
||||||
|
|
||||||
|
def plot(x, y, label):
|
||||||
|
plt.figure(1)
|
||||||
|
plt.plot(x, y, linewidth = 3, label = label)
|
||||||
|
plt.xlabel(r"$x$")
|
||||||
|
plt.ylabel(r"$y$")
|
||||||
|
plt.legend()
|
||||||
|
plt.grid(visible=True)
|
||||||
|
plt.axis("image")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Daten
|
||||||
|
x = np.linspace(0, 2, 203)
|
||||||
|
y = 0.4 * x + 1
|
||||||
|
|
||||||
|
plot(x, y, r"$y = {0.4x+1}$")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
# %%
|
||||||
Loading…
x
Reference in New Issue
Block a user