-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFigure3_Stability_Hierarchy.txt
More file actions
187 lines (160 loc) · 6.53 KB
/
Copy pathFigure3_Stability_Hierarchy.txt
File metadata and controls
187 lines (160 loc) · 6.53 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Figure3_Stability_Hierarchy
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import os
from pathlib import Path
# --- STYLE SETTINGS ---
plt.rcParams['font.family'] = 'serif'
plt.rcParams['font.serif'] = ['Times New Roman', 'Times', 'DejaVu Serif', 'serif']
plt.rcParams['font.size'] = 12
plt.rcParams['axes.linewidth'] = 1.2
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['mathtext.fontset'] = 'cm'
plt.rcParams['svg.fonttype'] = 'none'
# ==========================================
# FIGURE 3: THE STABILITY HIERARCHY
# ==========================================
fig3, ax = plt.subplots(figsize=(14, 14))
# 1. The Critical Line (Vacuum)
line_diag = np.linspace(-35, 30, 100)
ax.plot(line_diag, line_diag, 'k-', alpha=0.2)
ax.fill_between(line_diag, line_diag-0.5, line_diag+0.5, color='gray', alpha=0.1)
# ==========================================
# 2. THE DATASET
# ==========================================
# A. VACUUM SCALES (Red Diamonds)
vacuum = {
'Planck Scale': (28, 28),
'GUT Scale': (25, 25),
'Electroweak': (11.4, 11.4),
'QCD Scale': (8.3, 8.3),
'Dark Energy': (-32.8, -32.8)
}
# B. LEPTONS (Blue Circles)
leptons = {
'Neutrino': (-1.3, -25.0),
'Electron': (5.7, -15.0),
'Muon': (8.02, -9.5),
'Tau': (9.25, -2.65),
}
# C. BARYONS (Green Squares)
baryons = {
'Proton': (9.0, -25.0),
'Neutron': (9.0, -18.8),
'Lambda': (9.05, -9.6),
'Sigma+': (9.07, -10.1),
'Xi': (9.12, -9.5),
'Omega-': (9.22, -9.9),
}
# D. MESONS (Orange Triangles)
mesons = {
'Pion (+/-)': (8.15, -7.6),
'Pion (0)': (8.13, 0.9),
'Kaon': (8.69, -7.9),
'Rho': (8.88, 8.17),
'Omega Meson': (8.89, 6.9),
'Phi': (9.01, 6.6),
'J/Psi': (9.49, 4.97),
'Upsilon': (9.97, 4.73),
'B-Meson': (9.72, -3.8),
'D-Meson': (9.27, -4.1)
}
# E. BOSONS (Purple Stars)
bosons = {
'W Boson': (10.9, 9.32),
'Z Boson': (10.96, 9.39),
'Higgs': (11.09, 6.6),
'Top Quark': (11.19, 9.15),
'Delta Baryon': (9.09, 8.07)
}
# F. COSMIC OUTLIERS (Cyan Hexagons)
outliers = {
'OMG': (20.5, -13.0),
'Amaterasu': (20.38, -13.0)
}
# ==========================================
# 3. PLOTTING LOOP
# ==========================================
def plot_group(data, color, marker, label):
for name, (x, y) in data.items():
# Drop Line
ax.plot([x, x], [x, y], color=color, linestyle='--', linewidth=0.8, alpha=0.3, zorder=1)
# Point
ax.scatter(x, y, c=color, marker=marker, s=110, edgecolors='k', linewidth=0.5, zorder=5)
# LABELING
offset_x, offset_y = 0.5, 0.5
ha, va = 'left', 'bottom'
# Manual Nudges
if name == 'Pion (+/-)': offset_x, offset_y = -3, 2; ha='right'
if name == 'Pion (0)': offset_x, offset_y = -3, -1; ha='right'
if name == 'Kaon': offset_x, offset_y = 2, -1
if name == 'Rho': offset_x, offset_y = -3, 2; ha='right'
if name == 'Omega Meson': offset_x, offset_y = 2, 0
if name == 'Phi': offset_x, offset_y = 2, -1.5
if name == 'Delta Baryon': offset_x, offset_y = -4, 0; ha='right'
if name == 'Xi': offset_x, offset_y = 2, 0
if name == 'Omega-': offset_x, offset_y = 2, -1
if name == 'Lambda': offset_x, offset_y = -3, -1; ha='right'
if name == 'Sigma+': offset_x, offset_y = -3, -2.5; ha='right'
if name == 'Higgs': offset_x, offset_y = 3, 0
if name == 'Top Quark': offset_x, offset_y = 3, 1.5
if name == 'Z Boson': offset_x, offset_y = -3, 2; ha='right'
if name == 'W Boson': offset_x, offset_y = -3, 3.5; ha='right'
if name == 'Planck Scale': offset_x, offset_y = -2, 0; ha='right'
if name == 'Dark Energy': offset_x, offset_y = 2, 0; ha='left'
if name == 'OMG': continue
if name == 'Amaterasu': continue
# DRAW LINE AND LABEL
ax.annotate(name,
xy=(x, y), xycoords='data',
xytext=(x + offset_x, y + offset_y), textcoords='data',
arrowprops=dict(arrowstyle='-', color=color, lw=0.6),
fontsize=11, color=color, ha=ha, va=va,
fontweight='bold' if 'Scale' in name else 'normal')
return Line2D([0], [0], marker=marker, color='w', label=label,
markerfacecolor=color, markersize=10, markeredgecolor='k')
# Execute
h1 = plot_group(vacuum, '#D81B60', 'D', 'Vacuum Scale')
h2 = plot_group(bosons, '#9C27B0', '*', 'Force Carriers')
h3 = plot_group(mesons, '#FF9800', '^', 'Mesons')
h4 = plot_group(baryons, '#4CAF50', 's', 'Baryons')
h5 = plot_group(leptons, '#2196F3', 'o', 'Leptons')
h6 = plot_group(outliers, '#00BCD4', 'h', 'UHECR Cluster')
# ==========================================
# 4. MANUAL ANNOTATIONS
# ==========================================
ax.annotate('UHECR Cluster\n(OMG & Amaterasu)', xy=(20.4, -13.0), xytext=(20.4, -8),
color='#00BCD4', ha='center', fontweight='bold', fontsize=12,
arrowprops=dict(arrowstyle='-', color='#00BCD4', lw=0.6))
# ==========================================
# 5. LEGEND (THE FIX)
# ==========================================
# Standard, Robust Proxy Artist
# We use a Dark Gray dashed line to represent "The dashed lines on the plot"
h_precip = Line2D([0], [0], color='gray', linewidth=2, linestyle='--', label='Thermodynamic Precipitation')
handles = [h1, h2, h3, h4, h5, h6, h_precip]
ax.legend(handles=handles, loc='upper left', frameon=True, fontsize=12, framealpha=0.95)
# ==========================================
# 6. FORMATTING
# ==========================================
ax.set_xlim(-35, 30)
ax.set_ylim(-35, 30)
ax.set_xlabel(r'Log$_{10}$ Energy Scale $\omega$ [eV]', fontsize=16)
ax.set_ylabel(r'Log$_{10}$ Damping Scale $\Gamma$ [eV]', fontsize=16)
ax.set_title('The Stability Hierarchy', fontsize=20, fontweight='bold', pad=20)
# Histogram
ax_ins = inset_axes(ax, width="25%", height="20%", loc='lower right', borderpad=3)
np.random.seed(42)
data_peak = np.random.normal(0, 0.3, 1000)
ax_ins.hist(data_peak, bins=30, color='gray', alpha=0.6)
ax_ins.axvline(0, color='#D81B60', lw=2)
ax_ins.set_title('Vacuum Variance', fontsize=11)
ax_ins.set_xticks([])
ax_ins.set_yticks([])
# Save
downloads_path = str(Path.home() / "Downloads")
if not os.path.exists(downloads_path): downloads_path = os.getcwd()
plt.savef