Compare commits
No commits in common. "solutions" and "dev" have entirely different histories.
30
roz/1.py
30
roz/1.py
@ -1,30 +0,0 @@
|
|||||||
import matplotlib.pyplot as plt
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
# Zdefiniuj zakres wartości x
|
|
||||||
x = np.linspace(-10, 10, 400) # 400 punktów od -10 do 10
|
|
||||||
|
|
||||||
# Oblicz wartości y = x
|
|
||||||
y = x
|
|
||||||
|
|
||||||
# Narysuj wykres
|
|
||||||
plt.plot(x, y, label='y = x')
|
|
||||||
|
|
||||||
# Dodaj siatkę
|
|
||||||
plt.grid(True)
|
|
||||||
|
|
||||||
# Dodaj etykiety osi
|
|
||||||
plt.xlabel('x')
|
|
||||||
plt.ylabel('y')
|
|
||||||
|
|
||||||
# Dodaj tytuł
|
|
||||||
plt.title('Wykres funkcji liniowej y = x')
|
|
||||||
|
|
||||||
# Pokaż legendę
|
|
||||||
plt.legend()
|
|
||||||
|
|
||||||
# Ustaw skalę osi, żeby wyglądało proporcjonalnie
|
|
||||||
plt.axis('equal')
|
|
||||||
|
|
||||||
# Wyświetl wykres
|
|
||||||
plt.show()
|
|
||||||
Loading…
Reference in New Issue
Block a user