Update lesson_graph.py
Browse files- lesson_graph.py +2 -2
lesson_graph.py
CHANGED
@@ -160,7 +160,7 @@ class LessonGraph:
|
|
160 |
Visualize the graph using Matplotlib, handling layout, labels, and interactivity.
|
161 |
"""
|
162 |
fig, ax = plt.subplots(figsize=(14, 10))
|
163 |
-
pos = nx.spring_layout(self.graph, k=
|
164 |
|
165 |
self._draw_nodes(ax, pos)
|
166 |
self._draw_edges(ax, pos)
|
@@ -174,7 +174,7 @@ class LessonGraph:
|
|
174 |
|
175 |
# Save the plot to a BytesIO object
|
176 |
buf = BytesIO()
|
177 |
-
plt.savefig(buf, format="png", dpi=300, bbox_inches="tight")
|
178 |
buf.seek(0)
|
179 |
plt.close(fig)
|
180 |
|
|
|
160 |
Visualize the graph using Matplotlib, handling layout, labels, and interactivity.
|
161 |
"""
|
162 |
fig, ax = plt.subplots(figsize=(14, 10))
|
163 |
+
pos = nx.spring_layout(self.graph, k=1.2, iterations=100)
|
164 |
|
165 |
self._draw_nodes(ax, pos)
|
166 |
self._draw_edges(ax, pos)
|
|
|
174 |
|
175 |
# Save the plot to a BytesIO object
|
176 |
buf = BytesIO()
|
177 |
+
plt.savefig(buf, format="png", dpi=300, bbox_inches="tight", pad_inches=0.5)
|
178 |
buf.seek(0)
|
179 |
plt.close(fig)
|
180 |
|