Created
January 4, 2025 03:23
-
-
Save quandyfactory/7350e61e06037c138e0b873db2ba98eb to your computer and use it in GitHub Desktop.
Decision matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
# Create the figure and axis | |
fig, ax = plt.subplots(figsize=(8, 8)) | |
# Set up the grid for the decision matrix | |
ax.axhline(0.5, color='black', linewidth=1) # horizontal midline | |
ax.axvline(0.5, color='black', linewidth=1) # vertical midline | |
# Highlight the top-right quadrant | |
ax.add_patch(plt.Rectangle((0.5, 0.5), 0.5, 0.5, color='green', alpha=0.3)) | |
# Add quadrant labels | |
ax.text(0.25, 0.75, "Hard to Do / High Impact", fontsize=10, ha='center') | |
ax.text(0.25, 0.25, "Hard to Do / Low Impact", fontsize=10, ha='center') | |
ax.text(0.75, 0.25, "Easy to Do / Low Impact", fontsize=10, ha='center') | |
ax.text(0.75, 0.75, "Easy to Do / High Impact", fontsize=10, ha='center') | |
# Set the ticks and labels | |
ax.set_xticks([0, 0.5, 1]) | |
ax.set_yticks([0, 0.5, 1]) | |
ax.set_xticklabels(["Low Impact", "", "High Impact"]) | |
ax.set_yticklabels(["Hard to Do", "", "Easy to Do"]) | |
# Remove grid and spines | |
ax.grid(False) | |
ax.spines['top'].set_visible(False) | |
ax.spines['right'].set_visible(False) | |
ax.spines['left'].set_visible(False) | |
ax.spines['bottom'].set_visible(False) | |
# Adjust axis limits | |
ax.set_xlim(0, 1) | |
ax.set_ylim(0, 1) | |
# Display the plot | |
plt.title("Decision Matrix", fontsize=14, weight='bold') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment