|
1 | | -""" pyplots.ai |
| 1 | +"""pyplots.ai |
2 | 2 | line-retention-cohort: User Retention Curve by Cohort |
3 | 3 | Library: highcharts unknown | Python 3.14.3 |
4 | 4 | Quality: 84/100 | Created: 2026-03-16 |
|
47 | 47 | "type": "line", |
48 | 48 | "width": 4800, |
49 | 49 | "height": 2700, |
50 | | - "backgroundColor": "#ffffff", |
51 | | - "marginBottom": 200, |
| 50 | + "backgroundColor": "#fafafa", |
| 51 | + "marginBottom": 240, |
52 | 52 | "marginLeft": 200, |
53 | 53 | "marginRight": 180, |
54 | 54 | "marginTop": 160, |
| 55 | + "style": {"fontFamily": "'Segoe UI', 'Helvetica Neue', Arial, sans-serif"}, |
55 | 56 | } |
56 | 57 |
|
57 | 58 | chart.options.title = { |
58 | 59 | "text": "line-retention-cohort \u00b7 highcharts \u00b7 pyplots.ai", |
59 | | - "style": {"fontSize": "48px", "fontWeight": "bold"}, |
| 60 | + "style": {"fontSize": "48px", "fontWeight": "bold", "color": "#2a2a2a"}, |
60 | 61 | } |
61 | 62 |
|
62 | 63 | chart.options.subtitle = { |
63 | 64 | "text": "User Retention by Monthly Signup Cohort", |
64 | | - "style": {"fontSize": "32px", "color": "#666666"}, |
| 65 | + "style": {"fontSize": "32px", "color": "#777777"}, |
65 | 66 | } |
66 | 67 |
|
67 | 68 | # X-axis |
68 | 69 | chart.options.x_axis = { |
69 | 70 | "categories": week_labels, |
70 | | - "title": {"text": "Weeks Since Signup", "style": {"fontSize": "36px"}}, |
71 | | - "labels": {"style": {"fontSize": "28px"}}, |
| 71 | + "title": {"text": "Weeks Since Signup", "style": {"fontSize": "36px", "color": "#444444"}}, |
| 72 | + "labels": {"style": {"fontSize": "28px", "color": "#555555"}}, |
72 | 73 | "gridLineWidth": 0, |
| 74 | + "lineColor": "#cccccc", |
| 75 | + "lineWidth": 1, |
| 76 | + "tickWidth": 0, |
73 | 77 | } |
74 | 78 |
|
75 | 79 | # Y-axis |
76 | 80 | chart.options.y_axis = { |
77 | | - "title": {"text": "Retained Users (%)", "style": {"fontSize": "36px"}}, |
78 | | - "labels": {"style": {"fontSize": "28px"}, "format": "{value}%"}, |
| 81 | + "title": {"text": "Retained Users (%)", "style": {"fontSize": "36px", "color": "#444444"}}, |
| 82 | + "labels": {"style": {"fontSize": "28px", "color": "#555555"}, "format": "{value}%"}, |
79 | 83 | "min": 0, |
80 | 84 | "max": 100, |
81 | 85 | "tickInterval": 20, |
82 | 86 | "gridLineWidth": 1, |
83 | | - "gridLineColor": "rgba(0, 0, 0, 0.08)", |
| 87 | + "gridLineColor": "rgba(0, 0, 0, 0.06)", |
| 88 | + "gridLineDashStyle": "Dot", |
| 89 | + "lineWidth": 0, |
84 | 90 | "plotLines": [ |
85 | 91 | { |
86 | 92 | "value": 20, |
87 | | - "color": "#999999", |
88 | | - "dashStyle": "Dash", |
| 93 | + "color": "#b0413e", |
| 94 | + "dashStyle": "LongDash", |
89 | 95 | "width": 3, |
90 | 96 | "label": { |
91 | 97 | "text": "20% Retention Target", |
92 | 98 | "align": "right", |
93 | | - "style": {"fontSize": "24px", "color": "#999999", "fontStyle": "italic"}, |
| 99 | + "style": {"fontSize": "24px", "color": "#b0413e", "fontWeight": "600"}, |
94 | 100 | "x": -20, |
95 | | - "y": -12, |
| 101 | + "y": -14, |
96 | 102 | }, |
97 | 103 | } |
98 | 104 | ], |
|
101 | 107 | # Legend |
102 | 108 | chart.options.legend = { |
103 | 109 | "enabled": True, |
104 | | - "itemStyle": {"fontSize": "30px"}, |
| 110 | + "itemStyle": {"fontSize": "30px", "fontWeight": "normal", "color": "#444444"}, |
| 111 | + "itemHoverStyle": {"color": "#222222"}, |
105 | 112 | "symbolWidth": 80, |
106 | 113 | "symbolHeight": 20, |
107 | 114 | "layout": "vertical", |
|
128 | 135 | } |
129 | 136 | } |
130 | 137 |
|
131 | | -# Colors - distinct, colorblind-safe palette starting with Python Blue |
132 | | -colors = ["#306998", "#e07b39", "#2ca02c", "#d62728", "#8c564b"] |
| 138 | +# Colors - colorblind-safe palette starting with Python Blue |
| 139 | +colors = ["#306998", "#e07b39", "#8c564b", "#7b4f8a", "#d4a84b"] |
133 | 140 |
|
134 | 141 | # Add series - older cohorts first (thinner), newest last (thickest) |
135 | 142 | for i, (cohort, rates) in enumerate(retention_data.items()): |
|
0 commit comments