pvar_dashboard / src /plot_config.py
F1nnSBK's picture
Deploy Photovoltaik Risiko-Manager dashboard to Hugging Face Spaces
5841846
Raw
History Blame Contribute Delete
899 Bytes
import matplotlib.pyplot as plt
import seaborn as sns
def set_scientific_style():
"""Sets a unified, high-resolution scientific plotting style suitable for academic papers."""
try:
plt.style.use('seaborn-v0_8-paper')
except OSError:
# Fallback if the specific style is not found in the environment
plt.style.use('default')
sns.set_theme(
context='paper',
style='ticks',
palette='muted',
font='sans-serif',
font_scale=1.2
)
plt.rcParams.update({
'figure.figsize': (10, 6),
'figure.dpi': 300, # High resolution for paper export
'savefig.dpi': 300,
'savefig.bbox': 'tight',
'axes.spines.top': False, # Minimalist borders
'axes.spines.right': False,
'axes.linewidth': 1.0,
'grid.alpha': 0.3,
'grid.linestyle': '--'
})