Improve plot resolution and fix UUID syntax errors
Browse files- Increase DPI from 300 to 400 for even higher resolution on HuggingFace
- Increase font size from 11 to 12 for better readability
- Add detailed instructions about UUID generation syntax to prevent bracket errors
- Add instructions for high-resolution saving with bbox_inches='tight'
- Add warning about proper f-string bracket escaping in templates
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
src.py
CHANGED
|
@@ -251,8 +251,8 @@ import numpy as np
|
|
| 251 |
|
| 252 |
# Set professional matplotlib styling
|
| 253 |
plt.rcParams.update({{
|
| 254 |
-
'font.size':
|
| 255 |
-
'figure.dpi':
|
| 256 |
'figure.facecolor': 'white',
|
| 257 |
'axes.facecolor': 'white',
|
| 258 |
'axes.edgecolor': '#e2e8f0',
|
|
@@ -293,11 +293,13 @@ df["Timestamp"] = pd.to_datetime(df["Timestamp"])
|
|
| 293 |
3. If returning text/numbers, store the result directly in 'answer'
|
| 294 |
4. Use descriptive variable names and add comments
|
| 295 |
5. Handle potential errors gracefully
|
| 296 |
-
6. For plots, use unique filenames
|
| 297 |
7. Make plots professional with proper titles, labels, and styling
|
| 298 |
8. Use plt.tight_layout() before saving plots
|
| 299 |
9. For line plots, use linewidth=2.5 and markersize=8 for better visibility
|
| 300 |
10. Add proper axis labels with units (e.g., 'PM2.5 (µg/m³)')
|
|
|
|
|
|
|
| 301 |
"""
|
| 302 |
|
| 303 |
query = f"""{system_prompt}
|
|
|
|
| 251 |
|
| 252 |
# Set professional matplotlib styling
|
| 253 |
plt.rcParams.update({{
|
| 254 |
+
'font.size': 12,
|
| 255 |
+
'figure.dpi': 400,
|
| 256 |
'figure.facecolor': 'white',
|
| 257 |
'axes.facecolor': 'white',
|
| 258 |
'axes.edgecolor': '#e2e8f0',
|
|
|
|
| 293 |
3. If returning text/numbers, store the result directly in 'answer'
|
| 294 |
4. Use descriptive variable names and add comments
|
| 295 |
5. Handle potential errors gracefully
|
| 296 |
+
6. For plots, use unique filenames: f"plot_name_{{uuid.uuid4().hex[:8]}}.png" (note proper bracket syntax)
|
| 297 |
7. Make plots professional with proper titles, labels, and styling
|
| 298 |
8. Use plt.tight_layout() before saving plots
|
| 299 |
9. For line plots, use linewidth=2.5 and markersize=8 for better visibility
|
| 300 |
10. Add proper axis labels with units (e.g., 'PM2.5 (µg/m³)')
|
| 301 |
+
11. For high-resolution plots, use bbox_inches='tight', dpi=400 in plt.savefig()
|
| 302 |
+
12. IMPORTANT: Use double curly braces {{}} in f-strings within the template to avoid syntax errors
|
| 303 |
"""
|
| 304 |
|
| 305 |
query = f"""{system_prompt}
|