Skip to content

Instantly share code, notes, and snippets.

@puf
Last active July 31, 2025 23:02
Show Gist options
  • Save puf/fbb04401d6078a8f8b5c408728eb30d0 to your computer and use it in GitHub Desktop.
Save puf/fbb04401d6078a8f8b5c408728eb30d0 to your computer and use it in GitHub Desktop.
Test chart for sentiment post.ipynb
Display the source blob
Display the rendered blob
Raw
import matplotlib.pyplot as plt
import numpy as np
# Simulate a tech adoption curve
x = np.linspace(0, 10, 500)
y = np.exp(-((x - 3) ** 2)) * 2 + np.exp(-((x - 7) ** 2)) * 1.5
# Create figure
fig, ax = plt.subplots(figsize=(10, 6))
# Plot the curve
ax.plot(x, y, label="Public Sentiment", linewidth=2)
# Annotations
ax.annotate("Initial resistance", xy=(1, 0.1), xytext=(0.5, 0.5), arrowprops=dict(arrowstyle="->", lw=1.5, color="silver"), fontsize=12, ha="center", color="silver")
ax.annotate("We love this", xy=(2, 1), xytext=(1.0, 1.2), arrowprops=dict(arrowstyle="->", lw=1.5, color="silver"), fontsize=12, ha="center", color="silver")
ax.annotate("'It's overrated'", xy=(3.7, 1.3), xytext=(4.5, 1.5), arrowprops=dict(arrowstyle="->", lw=1.5, color="silver"), fontsize=12, ha="center", color="silver")
ax.annotate("'The worst!'", xy=(4.8, 0.25), xytext=(5.0, 0.5), arrowprops=dict(arrowstyle="->", lw=1.5, color="silver"), fontsize=12, ha="center", color="silver")
ax.annotate("'It's now a\nSupabase alternative'", xy=(6.0, 0.7), xytext=(5.2, 1.0), arrowprops=dict(arrowstyle="->", lw=1.5), fontsize=12, ha="center")
ax.annotate("'It can run Next.JS on Google Cloud'", xy=(6.5, 1.25), xytext=(6, 1.7), arrowprops=dict(arrowstyle="->", lw=1.5), fontsize=12, ha="center")
# Titles and labels
ax.set_title("Technology Sentiment Cycles Over Time", fontsize=16)
ax.set_xlabel("Time / Maturity", fontsize=12)
ax.set_ylabel("Public Sentiment", fontsize=12)
ax.grid(True)
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment