Spaces:
Sleeping
Sleeping
File size: 494 Bytes
4d07743 |
1 2 3 4 5 6 7 8 9 10 11 |
import matplotlib.pyplot as plt
def generate_graph(thickness, hole_diameter, force, max_stress, max_deformation):
fig, ax = plt.subplots()
ax.bar(["Thickness (mm)", "Hole Diameter (mm)", "Force (N)"], [thickness, hole_diameter, force], color=["#FFA07A", "#20B2AA", "#87CEEB"])
ax.set_title(f"Simulation Results: Stress={max_stress} Pa, Deformation={max_deformation} mm")
plt.tight_layout()
plt.savefig("dynamic_graph.png")
plt.close(fig)
return "dynamic_graph.png"
|