Optimize figure dimensions for sharp 900px display
Browse files- Set figsize to 6x3.75 inches at 300 DPI for 1800x1125px output
- Generates 2x resolution for crisp display at 900px width
- Removed redundant DPI settings to avoid conflicts
- Standardized configuration across all files
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- new_system_prompt.txt +2 -2
- src.py +5 -14
- vayuchat.mplstyle +3 -3
new_system_prompt.txt
CHANGED
@@ -33,8 +33,8 @@ DATA SAFETY:
|
|
33 |
- Use .dropna() to remove missing values before analysis
|
34 |
|
35 |
PLOTTING REQUIREMENTS:
|
36 |
-
- Create plots for visualization requests: plt.figure(figsize=(
|
37 |
-
- Save plots with
|
38 |
- Close plots: plt.close()
|
39 |
- Store filename: answer = filename
|
40 |
- For non-plots: answer = "text result"
|
|
|
33 |
- Use .dropna() to remove missing values before analysis
|
34 |
|
35 |
PLOTTING REQUIREMENTS:
|
36 |
+
- Create plots for visualization requests: plt.figure(figsize=(6, 3.75))
|
37 |
+
- Save plots with high resolution: filename = f"plot_{uuid.uuid4().hex[:8]}.png"; plt.savefig(filename, dpi=300, bbox_inches='tight', facecolor='white', edgecolor='none')
|
38 |
- Close plots: plt.close()
|
39 |
- Store filename: answer = filename
|
40 |
- For non-plots: answer = "text result"
|
src.py
CHANGED
@@ -145,11 +145,11 @@ def ask_question(model_name, question):
|
|
145 |
"""Safely execute generated code and handle errors"""
|
146 |
local_vars = {}
|
147 |
|
148 |
-
# Force matplotlib to use high
|
149 |
plt.style.use('vayuchat.mplstyle')
|
150 |
-
plt.rcParams['figure.dpi'] =
|
151 |
-
plt.rcParams['savefig.dpi'] =
|
152 |
-
plt.rcParams['figure.figsize'] = [
|
153 |
plt.rcParams['font.size'] = 14
|
154 |
plt.rcParams['axes.titlesize'] = 16
|
155 |
plt.rcParams['axes.labelsize'] = 14
|
@@ -267,17 +267,8 @@ import seaborn as sns
|
|
267 |
import uuid
|
268 |
import calendar
|
269 |
import numpy as np
|
270 |
-
# Set professional matplotlib styling with high
|
271 |
plt.style.use('vayuchat.mplstyle')
|
272 |
-
# Additional high-resolution settings
|
273 |
-
plt.rcParams['figure.dpi'] = 600
|
274 |
-
plt.rcParams['savefig.dpi'] = 600
|
275 |
-
plt.rcParams['font.size'] = 14
|
276 |
-
plt.rcParams['axes.titlesize'] = 16
|
277 |
-
plt.rcParams['axes.labelsize'] = 14
|
278 |
-
plt.rcParams['xtick.labelsize'] = 12
|
279 |
-
plt.rcParams['ytick.labelsize'] = 12
|
280 |
-
plt.rcParams['legend.fontsize'] = 12
|
281 |
df = pd.read_csv("AQ_met_data.csv")
|
282 |
df["Timestamp"] = pd.to_datetime(df["Timestamp"])
|
283 |
states_df = pd.read_csv("states_data.csv")
|
|
|
145 |
"""Safely execute generated code and handle errors"""
|
146 |
local_vars = {}
|
147 |
|
148 |
+
# Force matplotlib to use high resolution settings in exec environment
|
149 |
plt.style.use('vayuchat.mplstyle')
|
150 |
+
plt.rcParams['figure.dpi'] = 300
|
151 |
+
plt.rcParams['savefig.dpi'] = 300
|
152 |
+
plt.rcParams['figure.figsize'] = [6, 3.75]
|
153 |
plt.rcParams['font.size'] = 14
|
154 |
plt.rcParams['axes.titlesize'] = 16
|
155 |
plt.rcParams['axes.labelsize'] = 14
|
|
|
267 |
import uuid
|
268 |
import calendar
|
269 |
import numpy as np
|
270 |
+
# Set professional matplotlib styling with high resolution
|
271 |
plt.style.use('vayuchat.mplstyle')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
df = pd.read_csv("AQ_met_data.csv")
|
273 |
df["Timestamp"] = pd.to_datetime(df["Timestamp"])
|
274 |
states_df = pd.read_csv("states_data.csv")
|
vayuchat.mplstyle
CHANGED
@@ -13,10 +13,10 @@ ytick.labelsize: 11
|
|
13 |
legend.fontsize: 11
|
14 |
|
15 |
# Figure & DPI - Ultra High Resolution
|
16 |
-
figure.dpi:
|
17 |
figure.facecolor: white
|
18 |
figure.edgecolor: none
|
19 |
-
figure.figsize:
|
20 |
figure.autolayout: True
|
21 |
|
22 |
# Modern Color Palette (inspired by Tailwind/GitHub)
|
@@ -85,7 +85,7 @@ text.color: 1f2937
|
|
85 |
text.antialiased: True
|
86 |
|
87 |
# Savefig - Ultra High Resolution
|
88 |
-
savefig.dpi:
|
89 |
savefig.facecolor: white
|
90 |
savefig.edgecolor: none
|
91 |
savefig.bbox: tight
|
|
|
13 |
legend.fontsize: 11
|
14 |
|
15 |
# Figure & DPI - Ultra High Resolution
|
16 |
+
figure.dpi: 300
|
17 |
figure.facecolor: white
|
18 |
figure.edgecolor: none
|
19 |
+
figure.figsize: 6, 3.75
|
20 |
figure.autolayout: True
|
21 |
|
22 |
# Modern Color Palette (inspired by Tailwind/GitHub)
|
|
|
85 |
text.antialiased: True
|
86 |
|
87 |
# Savefig - Ultra High Resolution
|
88 |
+
savefig.dpi: 300
|
89 |
savefig.facecolor: white
|
90 |
savefig.edgecolor: none
|
91 |
savefig.bbox: tight
|