29 lines
524 B
Python
29 lines
524 B
Python
#%%
|
|
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()
|
|
# %%
|