File size: 759 Bytes
58e450d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import matplotlib.pyplot as plt
import seaborn as sns
def plot_engagement_heatmap(engagement_by_hour):
"""Plot engagement heatmap by time of day."""
plt.figure(figsize=(10, 6))
sns.heatmap(engagement_by_hour.pivot_table(index='hour', values='engagement_rate'), annot=True, cmap='YlGnBu')
plt.title('Engagement Heatmap by Time of Day')
plt.xlabel('Engagement Rate')
plt.ylabel('Hour of Day')
plt.show()
def plot_engagement_over_time(engagement_summary):
"""Plot engagement rate over time."""
plt.figure(figsize=(10, 6))
plt.plot(engagement_summary['posting_time'], engagement_summary['engagement_rate'])
plt.title('Engagement Rate Over Time')
plt.xlabel('Time')
plt.ylabel('Engagement Rate')
plt.show() |