Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a86badaea |
30
roz/1.py
Normal file
30
roz/1.py
Normal file
@ -0,0 +1,30 @@
|
||||
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