Untitled

 avatar
unknown
plain_text
5 months ago
1.6 kB
3
Indexable
import matplotlib.pyplot as plt

# Create the diagram
fig, ax = plt.subplots(figsize=(10, 6))

# Define nodes and connections for the framework
nodes = {
    "Development and Issues": (0.1, 0.7),
    "Impacts on Sarawak & Malaysia": (0.5, 0.7),
    "Malaysia’s Policy Responses": (0.9, 0.7),
    "Economic": (0.5, 0.5),
    "Security": (0.3, 0.3),
    "Environmental": (0.7, 0.3),
}

connections = [
    ("Development and Issues", "Impacts on Sarawak & Malaysia"),
    ("Impacts on Sarawak & Malaysia", "Malaysia’s Policy Responses"),
    ("Economic", "Impacts on Sarawak & Malaysia"),
    ("Security", "Impacts on Sarawak & Malaysia"),
    ("Environmental", "Impacts on Sarawak & Malaysia"),
    ("Impacts on Sarawak & Malaysia", "Economic"),
    ("Impacts on Sarawak & Malaysia", "Security"),
    ("Impacts on Sarawak & Malaysia", "Environmental"),
]

# Draw nodes
for node, (x, y) in nodes.items():
    ax.text(
        x, y, node, 
        ha="center", va="center", 
        bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="lightblue")
    )

# Draw connections
for start, end in connections:
    start_x, start_y = nodes[start]
    end_x, end_y = nodes[end]
    ax.arrow(
        start_x, start_y - 0.03 if start_y > end_y else start_y + 0.03,
        end_x - start_x, end_y - start_y,
        length_includes_head=True, head_width=0.02, head_length=0.03,
        color="black"
    )

# Adjust plot
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
ax.axis("off")

plt.title("Conceptual Framework of the Study", fontsize=14)
plt.show()
Editor is loading...
Leave a Comment