
Volcano Plot
Explore a Python volcano plot that places log2 fold change against -log10 p-value and colors points by fold-change and p-value thresholds.
Sample code / prompt
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
n_genes = 5000
log2fc = np.random.normal(0, 1.5, n_genes)
pvalues = 10 ** (-np.abs(log2fc) * np.random.uniform(0.5, 3, n_genes))
neg_log10p = -np.log10(pvalues)
fc_thresh = 1.0

