python_evaluation_code | "import matplotlib.pyplot as plt
import networkx as nx
# Create a directed graph
G = nx.DiGraph()
# Add nodes for inputs and outputs
G.add_node("Input 1", color='lightblue')
G.add_node("Input 2", color='lightblue')
G.add_node("Process", color='lightgreen')
G.add_node("Output 1", color='lightcoral')
G.add_node("Output 2", color='lightcoral')
# Add edges to represent the process flow
G.add_edges_from([
("Input 1", "Process"),
("Input 2", "Process"),
("Process", "Output 1"),
("Process", "Output 2")
])
# Define positions of nodes
pos = {
"Input 1": (-1, 1),
"Input 2": (-1, -1),
"Process": (0, 0),
"Output 1": (1, 1),
"Output 2": (1, -1)
}
# Draw the graph
plt.figure(figsize=(8, 6))
node_colors = [nx.get_node_attributes(G, "color")[node] for node in G.nodes()]
nx.draw(G, pos, with_labels=True, node_size=3000, node_color=node_colors, font_size=10, font_weight='bold', arrowsize=20)
plt.title("Process Flow Diagram")
plt.savefig("/tmp/output.png")
plt.show()" |
---|