import matplotlib.pyplot as plt2
import numpy as np
# 1. Define the x-range (e.g., from 0 to 16 with 1000 points)
x = np.linspace(0, 16, 1000)
# 2. Calculate the y-values using the equation (y = x**2)
A = - 1 /15
B = 8 / 5
y = A / 4 * pow(x, 4) + B / 3 * pow(x, 3)
ymax = A / 4 * pow(16, 4) + B / 3 * pow(16, 3)
y_label = "m"
y2_label = f"{ymax:.2f} "
# 3. Plot the data
plt2.figure(figsize=(8, 6)) # Optional: adjust plot size
plt2.plot(x, y)
# 4. Add customizations
plt2.xlabel("X-axis: seconds")
plt2.ylabel("Y-axis: m (blue)")
plt2.legend() # Show the legend
plt2.grid(True) # Add a grid
plt2.text(12,1000, y2_label)
plt2.text(14,1000, y_label)
# 5. Display the plot
plt2.show()