Skip to content

Instantly share code, notes, and snippets.

@QoT
QoT / plot_sst_sunspots.py
Created April 27, 2026 14:45
Plots SST anomaly vs sunspots since 1860 and computes R² (raw + detrended).
import pandas as pd
import matplotlib.pyplot as plt
# ====================== CONFIG ======================
plt.style.use('seaborn-v0_8-whitegrid')
# ===================================================
# 1. Sunspots
print("Downloading Sunspot data...")
sun_url = "https://www.sidc.be/SILSO/DATA/SN_m_tot_V2.0.txt"