diff --git a/examples/statistics/hist.py b/examples/statistics/hist.py index 5fd409911c89..68277b52f183 100644 --- a/examples/statistics/hist.py +++ b/examples/statistics/hist.py @@ -12,7 +12,7 @@ from matplotlib.ticker import PercentFormatter # Fixing random state for reproducibility -np.random.seed(19680801) +rng = np.random.default_rng(seed=19680801) ############################################################################### @@ -27,8 +27,8 @@ n_bins = 20 # Generate a normal distribution, center at x=0 and y=5 -x = np.random.randn(N_points) -y = .4 * x + np.random.randn(100000) + 5 +x = rng.standard_normal(N_points) +y = .4 * x + rng.standard_normal(100000) + 5 fig, axs = plt.subplots(1, 2, sharey=True, tight_layout=True)