|
1 | | -""" pyplots.ai |
| 1 | +"""pyplots.ai |
2 | 2 | area-elevation-profile: Terrain Elevation Profile Along Transect |
3 | 3 | Library: pygal 3.1.0 | Python 3.14.3 |
4 | 4 | Quality: 86/100 | Created: 2026-03-15 |
|
51 | 51 | TYPE_COLORS = { |
52 | 52 | "summit": "#b5342b", # deep red for highest point |
53 | 53 | "pass": "#c45a00", # orange for mountain passes |
54 | | - "hut": "#8b6914", # warm brown for alpine huts |
| 54 | + "hut": "#7b4ea0", # purple for alpine huts (distinct from orange) |
55 | 55 | "valley": "#2a7f3f", # green for valley floors |
56 | 56 | "town": "#306998", # blue for towns/settlements |
57 | 57 | } |
|
63 | 63 | foreground="#2d2d2d", |
64 | 64 | foreground_strong="#2d2d2d", |
65 | 65 | foreground_subtle="#e8e8e8", |
66 | | - colors=("#4a7fb5", "#c45a00"), |
| 66 | + colors=("#4a7fb5", "#d4690e"), |
67 | 67 | font_family="DejaVu Sans, Helvetica, Arial, sans-serif", |
68 | 68 | title_font_family="DejaVu Sans, Helvetica, Arial, sans-serif", |
69 | 69 | title_font_size=48, |
|
75 | 75 | label_font_family="DejaVu Sans, Helvetica, Arial, sans-serif", |
76 | 76 | major_label_font_family="DejaVu Sans, Helvetica, Arial, sans-serif", |
77 | 77 | value_font_family="DejaVu Sans, Helvetica, Arial, sans-serif", |
78 | | - opacity=0.6, |
79 | | - opacity_hover=0.7, |
| 78 | + opacity=0.65, |
| 79 | + opacity_hover=0.75, |
80 | 80 | guide_stroke_color="#e8e8e8", |
81 | 81 | guide_stroke_dasharray="4,4", |
82 | 82 | major_guide_stroke_color="#d0d0d0", |
|
120 | 120 | xrange=(0, 128), |
121 | 121 | show_minor_x_labels=False, |
122 | 122 | show_minor_y_labels=False, |
| 123 | + truncate_legend=-1, |
| 124 | + dynamic_print_values=True, |
| 125 | + print_values=False, |
| 126 | + show_x_labels=True, |
| 127 | + show_y_labels=True, |
| 128 | + x_labels_major_count=7, |
| 129 | + y_labels_major_count=6, |
123 | 130 | ) |
124 | 131 |
|
125 | 132 | # Elevation profile as filled XY series |
|
199 | 206 | vline.set("stroke", lm_color) |
200 | 207 | vline.set("stroke-width", "2") |
201 | 208 | vline.set("stroke-dasharray", "8,5") |
202 | | - vline.set("opacity", "0.45") |
| 209 | + vline.set("opacity", "0.55") |
203 | 210 |
|
204 | 211 | # Landmark name (bold, colored by type) |
205 | 212 | name_el = ET.SubElement(parent_elem, f"{ns}text") |
206 | 213 | name_el.set("x", f"{cx + dx:.1f}") |
207 | 214 | name_el.set("y", f"{cy + y_off:.1f}") |
208 | 215 | name_el.set("text-anchor", anchor) |
209 | | - name_el.set("font-size", "30") |
| 216 | + name_el.set("font-size", "32") |
210 | 217 | name_el.set("font-family", "DejaVu Sans, Helvetica, Arial, sans-serif") |
211 | 218 | name_el.set("fill", lm_color) |
212 | 219 | name_el.set("font-weight", "bold") |
|
219 | 226 | elev_el.set("text-anchor", anchor) |
220 | 227 | elev_el.set("font-size", "26") |
221 | 228 | elev_el.set("font-family", "DejaVu Sans, Helvetica, Arial, sans-serif") |
222 | | - elev_el.set("fill", "#777777") |
| 229 | + elev_el.set("fill", "#555555") |
223 | 230 | elev_el.text = f"{lm['elev']:.0f} m" |
224 | 231 |
|
225 | 232 | # Add vertical exaggeration note (spec requirement) - positioned bottom-right |
226 | 233 | note_el = ET.SubElement(root, f"{ns}text") |
227 | 234 | note_el.set("x", "4650") |
228 | 235 | note_el.set("y", f"{plot_bottom_y + 48:.0f}") |
229 | 236 | note_el.set("text-anchor", "end") |
230 | | -note_el.set("font-size", "24") |
| 237 | +note_el.set("font-size", "28") |
231 | 238 | note_el.set("font-family", "DejaVu Sans, Helvetica, Arial, sans-serif") |
232 | | -note_el.set("fill", "#999999") |
| 239 | +note_el.set("fill", "#555555") |
233 | 240 | note_el.set("font-style", "italic") |
234 | 241 | note_el.text = "Vertical exaggeration ~10\u00d7 for terrain visibility" |
235 | 242 |
|
|
0 commit comments