Spaces:
Build error
Build error
Update hardy_cross_plot.py
Browse files- hardy_cross_plot.py +6 -2
hardy_cross_plot.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import matplotlib.pyplot as plt
|
|
|
|
| 2 |
|
| 3 |
-
def plot_hardy_cross_network(final_flows_df, title="Hardy Cross Network Flows", save_path="
|
| 4 |
pipe_coords = {
|
| 5 |
"AB": [(0, 2), (5, 2)],
|
| 6 |
"BC": [(5, 2), (5, 1)],
|
|
@@ -28,4 +29,7 @@ def plot_hardy_cross_network(final_flows_df, title="Hardy Cross Network Flows",
|
|
| 28 |
ax.text(x, y - 0.15, node, fontsize=12, weight='bold')
|
| 29 |
plt.savefig(save_path, bbox_inches='tight', dpi=300)
|
| 30 |
plt.close()
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import matplotlib.pyplot as plt
|
| 2 |
+
import os
|
| 3 |
|
| 4 |
+
def plot_hardy_cross_network(final_flows_df, title="Hardy Cross Network Flows", save_path="hardy_cross_network_result.png"):
|
| 5 |
pipe_coords = {
|
| 6 |
"AB": [(0, 2), (5, 2)],
|
| 7 |
"BC": [(5, 2), (5, 1)],
|
|
|
|
| 29 |
ax.text(x, y - 0.15, node, fontsize=12, weight='bold')
|
| 30 |
plt.savefig(save_path, bbox_inches='tight', dpi=300)
|
| 31 |
plt.close()
|
| 32 |
+
|
| 33 |
+
# Ensure returning the absolute file path
|
| 34 |
+
absolute_path = os.path.abspath(save_path)
|
| 35 |
+
return absolute_path
|