File size: 899 Bytes
5841846
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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': '--'
    })