22 lines
479 B
Python
22 lines
479 B
Python
import matplotlib.pyplot as plt
|
||
import requests
|
||
|
||
|
||
points_x = []
|
||
points_y = []
|
||
for point in requests.get("https://physics.zzvt.pw/api/interpolation?h=10&l=6&g=10&alpha=0.5&count=100").json():
|
||
points_x.append(point["x"])
|
||
points_y.append(point["y"])
|
||
|
||
|
||
plt.figure(figsize=(10, 6))
|
||
|
||
plt.scatter(points_x, points_y, c="blue", label="Точки", alpha=0.6)
|
||
|
||
plt.xlabel("x")
|
||
plt.ylabel("y")
|
||
plt.title("График с точками")
|
||
plt.legend()
|
||
plt.grid()
|
||
|
||
plt.show() |