diff --git a/fads/btagging.go b/fads/btagging.go index cdffb0b97..6fc8812e6 100644 --- a/fads/btagging.go +++ b/fads/btagging.go @@ -6,12 +6,12 @@ package fads import ( "math" + "math/rand/v2" "reflect" "sync" "go-hep.org/x/hep/fmom" "go-hep.org/x/hep/fwk" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -74,7 +74,7 @@ func (tsk *BTagging) Configure(ctx fwk.Context) error { return err } - tsk.src = rand.New(rand.NewSource(tsk.seed)) + tsk.src = rand.New(rand.NewPCG(tsk.seed, tsk.seed)) tsk.flat = distuv.Uniform{Min: 0, Max: 1, Src: tsk.src} return err } diff --git a/fads/calo.go b/fads/calo.go index 3da152090..83c2efa58 100644 --- a/fads/calo.go +++ b/fads/calo.go @@ -7,12 +7,12 @@ package fads import ( "fmt" "math" + "math/rand/v2" "reflect" "sort" "sync" "go-hep.org/x/hep/fwk" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -206,7 +206,7 @@ func (tsk *Calorimeter) Configure(ctx fwk.Context) error { return err } - tsk.src = rand.New(rand.NewSource(tsk.seed)) + tsk.src = rand.New(rand.NewPCG(tsk.seed, tsk.seed)) tsk.gauss = distuv.Normal{Mu: 0, Sigma: 1, Src: tsk.src} return err } diff --git a/fads/efficiency.go b/fads/efficiency.go index 7f0f92ae5..34daafc69 100644 --- a/fads/efficiency.go +++ b/fads/efficiency.go @@ -5,11 +5,11 @@ package fads import ( + "math/rand/v2" "reflect" "sync" "go-hep.org/x/hep/fwk" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -42,7 +42,7 @@ func (tsk *Efficiency) Configure(ctx fwk.Context) error { func (tsk *Efficiency) StartTask(ctx fwk.Context) error { var err error - src := rand.New(rand.NewSource(tsk.seed)) + src := rand.New(rand.NewPCG(tsk.seed, tsk.seed)) tsk.dist = distuv.Uniform{Min: 0, Max: 1, Src: src} return err } diff --git a/fads/energy_smearing.go b/fads/energy_smearing.go index 5eb335f14..96db3c931 100644 --- a/fads/energy_smearing.go +++ b/fads/energy_smearing.go @@ -6,12 +6,12 @@ package fads import ( "math" + "math/rand/v2" "reflect" "sync" "go-hep.org/x/hep/fmom" "go-hep.org/x/hep/fwk" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -45,7 +45,7 @@ func (tsk *EnergySmearing) Configure(ctx fwk.Context) error { func (tsk *EnergySmearing) StartTask(ctx fwk.Context) error { var err error - tsk.src = rand.New(rand.NewSource(tsk.seed)) + tsk.src = rand.New(rand.NewPCG(tsk.seed, tsk.seed)) return err } diff --git a/fads/momentum_smearing.go b/fads/momentum_smearing.go index 443a9c738..c4e22f077 100644 --- a/fads/momentum_smearing.go +++ b/fads/momentum_smearing.go @@ -6,12 +6,12 @@ package fads import ( "math" + "math/rand/v2" "reflect" "sync" "go-hep.org/x/hep/fmom" "go-hep.org/x/hep/fwk" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -45,7 +45,7 @@ func (tsk *MomentumSmearing) Configure(ctx fwk.Context) error { func (tsk *MomentumSmearing) StartTask(ctx fwk.Context) error { var err error - tsk.src = rand.New(rand.NewSource(tsk.seed)) + tsk.src = rand.New(rand.NewPCG(tsk.seed, tsk.seed)) return err } diff --git a/fads/tautagging.go b/fads/tautagging.go index 4835985dc..d647bbe11 100644 --- a/fads/tautagging.go +++ b/fads/tautagging.go @@ -6,12 +6,12 @@ package fads import ( "math" + "math/rand/v2" "reflect" "sync" "go-hep.org/x/hep/fmom" "go-hep.org/x/hep/fwk" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -90,7 +90,7 @@ func (tsk *TauTagging) Configure(ctx fwk.Context) error { return err } - tsk.src = rand.New(rand.NewSource(tsk.seed)) + tsk.src = rand.New(rand.NewPCG(tsk.seed, tsk.seed)) tsk.flat = distuv.Uniform{Min: 0, Max: 1, Src: tsk.src} return err } diff --git a/fit/curve_nd_test.go b/fit/curve_nd_test.go index a12221fc6..de401713e 100644 --- a/fit/curve_nd_test.go +++ b/fit/curve_nd_test.go @@ -5,9 +5,8 @@ package fit_test import ( + "math/rand/v2" "testing" - - "golang.org/x/exp/rand" ) func TestCurve2D(t *testing.T) { @@ -18,7 +17,7 @@ func genData2D(n0, n1 int, f func(x, ps []float64) float64, ps []float64, x0min, var ( xdata = make([][]float64, n0*n1) ydata = make([]float64, n0*n1) - rnd = rand.New(rand.NewSource(1234)) + rnd = rand.New(rand.NewPCG(1234, 1234)) x0step = (x0max - x0min) / float64(n0) x1step = (x1max - x1min) / float64(n1) p = make([]float64, len(ps)) diff --git a/fit/hist_example_test.go b/fit/hist_example_test.go index fe9977940..4a0bdd16b 100644 --- a/fit/hist_example_test.go +++ b/fit/hist_example_test.go @@ -8,11 +8,11 @@ import ( "image/color" "log" "math" + "math/rand/v2" "go-hep.org/x/hep/fit" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/floats" "gonum.org/v1/gonum/optimize" "gonum.org/v1/gonum/stat/distuv" @@ -25,7 +25,7 @@ func ExampleH1D_gaussian() { mean = 2.0 sigma = 4.0 // Values from gonum/optimize: - want = []float64{447.0483517081991, 2.02127773281178, 3.9965893891862687} + want = []float64{450.56454241860934, 2.0146898541006277, 3.9613086671267466} // Values from ROOT: // want = []float64{4.53720e+02, 1.93218e+00, 3.93188e+00} ) @@ -36,7 +36,7 @@ func ExampleH1D_gaussian() { dist := distuv.Normal{ Mu: mean, Sigma: sigma, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard diff --git a/fit/testdata/2d-plane-plot_golden.png b/fit/testdata/2d-plane-plot_golden.png index e3cc9f950..71f86fdf0 100644 Binary files a/fit/testdata/2d-plane-plot_golden.png and b/fit/testdata/2d-plane-plot_golden.png differ diff --git a/fit/testdata/h1d-gauss-plot_golden.png b/fit/testdata/h1d-gauss-plot_golden.png index eeaf44465..1e41cec16 100644 Binary files a/fit/testdata/h1d-gauss-plot_golden.png and b/fit/testdata/h1d-gauss-plot_golden.png differ diff --git a/groot/rhist/hist_example_test.go b/groot/rhist/hist_example_test.go index 5713f5105..f6bb30e66 100644 --- a/groot/rhist/hist_example_test.go +++ b/groot/rhist/hist_example_test.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "log" + "math/rand/v2" "os" "testing" @@ -18,7 +19,6 @@ import ( "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hbook/rootcnv" "go-hep.org/x/hep/hbook/yodacnv" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -38,7 +38,7 @@ func ExampleCreate_histo1D() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -87,12 +87,12 @@ func ExampleCreate_histo1D() { // Output: // original histo: - // w-mean: 0.0023919 - // w-rms: 1.0628679 + // w-mean: -0.0010939 + // w-rms: 1.0575275 // // histo read back: - // r-mean: 0.0023919 - // r-rms: 1.0628679 + // r-mean: -0.0010939 + // r-rms: 1.0575275 } func ExampleCreate_histo2D() { @@ -111,7 +111,7 @@ func ExampleCreate_histo2D() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -166,16 +166,16 @@ func ExampleCreate_histo2D() { // Output: // original histo: - // w-mean-x: +0.046442 - // w-rms-x: +1.231044 - // w-mean-y: -0.018977 - // w-rms-y: +1.253143 + // w-mean-x: +0.016810 + // w-rms-x: +1.256504 + // w-mean-y: +0.030289 + // w-rms-y: +1.300039 // // histo read back: - // w-mean-x: +0.046442 - // w-rms-x: +1.231044 - // w-mean-y: -0.018977 - // w-rms-y: +1.253143 + // w-mean-x: +0.016810 + // w-rms-x: +1.256504 + // w-mean-y: +0.030289 + // w-rms-y: +1.300039 } func TestH1(t *testing.T) { @@ -185,7 +185,7 @@ func TestH1(t *testing.T) { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -285,7 +285,7 @@ func TestH2(t *testing.T) { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard diff --git a/groot/rtree/writer_test.go b/groot/rtree/writer_test.go index b8149d780..4d1fff2ee 100644 --- a/groot/rtree/writer_test.go +++ b/groot/rtree/writer_test.go @@ -7,6 +7,7 @@ package rtree import ( "compress/flate" "fmt" + "math/rand/v2" "os" "path/filepath" "reflect" @@ -16,7 +17,6 @@ import ( "go-hep.org/x/hep/groot/internal/rcompress" "go-hep.org/x/hep/groot/rbase" "go-hep.org/x/hep/groot/riofs" - "golang.org/x/exp/rand" ) func TestFlattenArrayType(t *testing.T) { @@ -143,9 +143,9 @@ func TestConcurrentWrite(t *testing.T) { } defer w.Close() - rng := rand.New(rand.NewSource(1234)) + rng := rand.New(rand.NewPCG(1234, 1234)) for i := 0; i < 100; i++ { - evt.N = rng.Int31n(10) + 1 + evt.N = rng.Int32N(10) + 1 evt.Sli = evt.Sli[:0] for j := 0; j < int(evt.N); j++ { evt.Sli = append(evt.Sli, rng.Float64()) @@ -288,9 +288,9 @@ func TestWriterWithCompression(t *testing.T) { } defer w.Close() - rng := rand.New(rand.NewSource(1234)) + rng := rand.New(rand.NewPCG(1234, 1234)) for i := 0; i < 100; i++ { - evt.N = rng.Int31n(10) + 1 + evt.N = rng.Int32N(10) + 1 evt.Sli = evt.Sli[:0] for j := 0; j < int(evt.N); j++ { evt.Sli = append(evt.Sli, rng.Float64()) diff --git a/hbook/h1d_example_test.go b/hbook/h1d_example_test.go index 16033d3bb..e3e6453dd 100644 --- a/hbook/h1d_example_test.go +++ b/hbook/h1d_example_test.go @@ -7,9 +7,9 @@ package hbook_test import ( "fmt" "math" + "math/rand/v2" "go-hep.org/x/hep/hbook" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -20,7 +20,7 @@ func ExampleH1D() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -34,16 +34,16 @@ func ExampleH1D() { h.FillN([]float64{1, 2, 3}, []float64{1, 1, 1}) h.FillN([]float64{1, 2, 3}, nil) // all weights are 1. - fmt.Printf("mean: %v\n", h.XMean()) - fmt.Printf("rms: %v\n", h.XRMS()) - fmt.Printf("std-dev: %v\n", h.XStdDev()) - fmt.Printf("std-err: %v\n", h.XStdErr()) + fmt.Printf("mean: %.12f\n", h.XMean()) + fmt.Printf("rms: %.12f\n", h.XRMS()) + fmt.Printf("std-dev: %.12f\n", h.XStdDev()) + fmt.Printf("std-err: %.12f\n", h.XStdErr()) // Output: - // mean: 0.005589967511734562 - // rms: 1.0062596231244403 - // std-dev: 1.0062943821322063 - // std-err: 0.010059926295994191 + // mean: 0.002104228518 + // rms: 1.000617135827 + // std-dev: 1.000664927794 + // std-err: 0.010003648633 } func ExampleAddH1D() { diff --git a/hbook/h2d_example_test.go b/hbook/h2d_example_test.go index 93bf09e0b..01e41b709 100644 --- a/hbook/h2d_example_test.go +++ b/hbook/h2d_example_test.go @@ -6,9 +6,9 @@ package hbook_test import ( "log" + "math/rand/v2" "go-hep.org/x/hep/hbook" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/mat" "gonum.org/v1/gonum/stat/distmv" ) @@ -21,7 +21,7 @@ func ExampleH2D() { dist, ok := distmv.NewNormal( []float64{0, 1}, mat.NewSymDense(2, []float64{4, 0, 0, 2}), - rand.New(rand.NewSource(1234)), + rand.New(rand.NewPCG(1234, 1234)), ) if !ok { log.Fatalf("error creating distmv.Normal") diff --git a/hbook/p1d_example_test.go b/hbook/p1d_example_test.go index 37d4126f7..3235d7248 100644 --- a/hbook/p1d_example_test.go +++ b/hbook/p1d_example_test.go @@ -7,9 +7,9 @@ package hbook_test import ( "fmt" "log" + "math/rand/v2" "go-hep.org/x/hep/hbook" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/mat" "gonum.org/v1/gonum/stat/distmv" ) @@ -21,7 +21,7 @@ func ExampleP1D() { dist, ok := distmv.NewNormal( []float64{0, 1}, mat.NewSymDense(2, []float64{4, 0, 0, 2}), - rand.New(rand.NewSource(1234)), + rand.New(rand.NewPCG(1234, 1234)), ) if !ok { log.Fatalf("error creating distmv.Normal") @@ -41,8 +41,8 @@ func ExampleP1D() { fmt.Printf("std-err: %v\n", p.XStdErr()) // Output: - // mean: 0.11198383683853215 - // rms: 2.0240892891977125 - // std-dev: 2.0220003848882695 - // std-err: 0.06394126645984038 + // mean: 0.0965063103552738 + // rms: 2.0024868956390707 + // std-dev: 2.0011608991313086 + // std-err: 0.06328226405725404 } diff --git a/hbook/rand_h1d.go b/hbook/rand_h1d.go index 6fc9a4d48..0c1e6dd44 100644 --- a/hbook/rand_h1d.go +++ b/hbook/rand_h1d.go @@ -5,9 +5,9 @@ package hbook import ( + "math/rand/v2" "sort" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) diff --git a/hbook/rand_h1d_example_test.go b/hbook/rand_h1d_example_test.go index 280b87d39..08ef7cfb1 100644 --- a/hbook/rand_h1d_example_test.go +++ b/hbook/rand_h1d_example_test.go @@ -8,13 +8,13 @@ import ( "fmt" "image/color" "log" + "math/rand/v2" "os" "path" "testing" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot/cmpimg" "gonum.org/v1/plot/vg" @@ -24,7 +24,7 @@ func ExampleRand1D() { const N = 10000 var ( h1 = hbook.NewH1D(100, -10, 10) - src = rand.New(rand.NewSource(1234)) + src = rand.New(rand.NewPCG(1234, 1234)) rnd = distuv.Normal{ Mu: 0, Sigma: 2, @@ -38,7 +38,7 @@ func ExampleRand1D() { var ( h2 = hbook.NewH1D(100, -10, 10) - hr = hbook.NewRand1D(h1, rand.NewSource(5678)) + hr = hbook.NewRand1D(h1, rand.NewPCG(5678, 5678)) ) for i := 0; i < N; i++ { @@ -101,10 +101,10 @@ func ExampleRand1D() { } // Output: - // h1: mean=+0.020436 std-dev=+1.992307 +/- 0.019923 + // h1: mean=+0.011317 std-dev=+2.027279 +/- 0.020273 // cdf(0)= +0.5 // cdf(1)= +0.7 - // h2: mean=-0.003631 std-dev=+2.008359 +/- 0.020084 + // h2: mean=-0.026749 std-dev=+2.022967 +/- 0.020230 // cdf(0)= +0.5 // cdf(1)= +0.7 } diff --git a/hbook/rand_h1d_test.go b/hbook/rand_h1d_test.go index 5f1746248..b8a1a2fe1 100644 --- a/hbook/rand_h1d_test.go +++ b/hbook/rand_h1d_test.go @@ -5,11 +5,11 @@ package hbook import ( + "math/rand/v2" "reflect" "testing" "github.com/google/go-cmp/cmp" - "golang.org/x/exp/rand" ) func TestRand1D(t *testing.T) { @@ -22,7 +22,7 @@ func TestRand1D(t *testing.T) { 3, 3, 3, 3, 3, }, nil) - hr := NewRand1D(h1, rand.NewSource(1234)) + hr := NewRand1D(h1, rand.NewPCG(1234, 1234)) h2 := NewH1DFromEdges(edges) if got, want := hr.cdf, []float64{0, 0.1, 0.4, 0.5, 1}; !reflect.DeepEqual(got, want) { @@ -82,17 +82,17 @@ Path: / Title: "" Type: Histo1D --- -# Mean: 2.502788e+00 +# Mean: 2.494672e+00 # Area: 1.000000e+00 # ID ID sumw sumw2 sumwx sumwx2 numEntries -Total Total 1.000000e+00 1.000000e-03 2.502788e+00 7.531549e+00 1.000000e+03 +Total Total 1.000000e+00 1.000000e-03 2.494672e+00 7.510616e+00 1.000000e+03 Underflow Underflow 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 Overflow Overflow 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 # xlow xhigh sumw sumw2 sumwx sumwx2 numEntries -0.000000e+00 1.000000e+00 9.200000e-02 9.200000e-05 4.339693e-02 2.823985e-02 9.200000e+01 -1.000000e+00 2.000000e+00 3.090000e-01 3.090000e-04 4.611849e-01 7.110522e-01 3.090000e+02 -2.000000e+00 3.000000e+00 8.700000e-02 8.700000e-05 2.154025e-01 5.413794e-01 8.700000e+01 -3.000000e+00 4.000000e+00 5.120000e-01 5.120000e-04 1.782804e+00 6.250877e+00 5.120000e+02 +0.000000e+00 1.000000e+00 9.800000e-02 9.800000e-05 4.971524e-02 3.505977e-02 9.800000e+01 +1.000000e+00 2.000000e+00 3.110000e-01 3.110000e-04 4.633349e-01 7.148637e-01 3.110000e+02 +2.000000e+00 3.000000e+00 8.900000e-02 8.900000e-05 2.272178e-01 5.882321e-01 8.900000e+01 +3.000000e+00 4.000000e+00 5.020000e-01 5.020000e-04 1.754404e+00 6.172460e+00 5.020000e+02 END YODA_HISTO1D_V2 ` diff --git a/hbook/rootcnv/root_test.go b/hbook/rootcnv/root_test.go index 7da45ab63..3600ba87f 100644 --- a/hbook/rootcnv/root_test.go +++ b/hbook/rootcnv/root_test.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "log" + "math/rand/v2" "reflect" "runtime" "testing" @@ -19,7 +20,6 @@ import ( "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hbook/rootcnv" "go-hep.org/x/hep/hbook/yodacnv" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" ) @@ -383,7 +383,7 @@ func TestFromH1D(t *testing.T) { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -467,7 +467,7 @@ func TestFromH2D(t *testing.T) { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard diff --git a/hbook/testdata/rand_h1d_golden.png b/hbook/testdata/rand_h1d_golden.png index 2ade7f927..e62ea4218 100644 Binary files a/hbook/testdata/rand_h1d_golden.png and b/hbook/testdata/rand_h1d_golden.png differ diff --git a/hplot/band_example_test.go b/hplot/band_example_test.go index 0dca8cff3..9d019b180 100644 --- a/hplot/band_example_test.go +++ b/hplot/band_example_test.go @@ -8,9 +8,9 @@ import ( "image/color" "log" "math" + "math/rand/v2" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot/plotter" "gonum.org/v1/plot/vg" @@ -28,7 +28,7 @@ func ExampleBand() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } topData := make(plotter.XYs, npoints) diff --git a/hplot/binerrband_example_test.go b/hplot/binerrband_example_test.go index 36cb26578..34021fa80 100644 --- a/hplot/binerrband_example_test.go +++ b/hplot/binerrband_example_test.go @@ -7,13 +7,12 @@ package hplot_test import ( "image/color" "log" - - "golang.org/x/exp/rand" - "gonum.org/v1/gonum/stat/distuv" - "gonum.org/v1/plot/vg" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" + "gonum.org/v1/gonum/stat/distuv" + "gonum.org/v1/plot/vg" ) // An example of making a colored binned error band @@ -111,6 +110,6 @@ var ( gauss = distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } ) diff --git a/hplot/example_test.go b/hplot/example_test.go index db944c68e..b679eb12d 100644 --- a/hplot/example_test.go +++ b/hplot/example_test.go @@ -8,11 +8,11 @@ import ( "image/color" "log" "math" + "math/rand/v2" "os" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot/vg" "gonum.org/v1/plot/vg/draw" @@ -27,7 +27,7 @@ func Example_subplot() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -113,7 +113,7 @@ func Example_latexplot() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } hist := hbook.NewH1D(20, -4, +4) diff --git a/hplot/h1d_example_test.go b/hplot/h1d_example_test.go index 5c21908f6..ffb25715c 100644 --- a/hplot/h1d_example_test.go +++ b/hplot/h1d_example_test.go @@ -7,10 +7,10 @@ package hplot_test import ( "image/color" "log" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot" "gonum.org/v1/plot/plotutil" @@ -26,7 +26,7 @@ func ExampleH1D() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -79,7 +79,7 @@ func ExampleH1D_toPDF() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -180,7 +180,7 @@ func ExampleH1D_withYErrBars() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -237,7 +237,7 @@ func ExampleH1D_withYErrBars_withBand() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -295,7 +295,7 @@ func ExampleH1D_withYErrBarsAndData() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -363,7 +363,7 @@ func ExampleH1D_withPlotBorders() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard @@ -432,7 +432,7 @@ func ExampleH1D_legendStyle() { dist := distuv.Normal{ Mu: mu, Sigma: sigma, - Src: rand.New(rand.NewSource(uint64(id))), + Src: rand.New(rand.NewPCG(uint64(id), uint64(id))), } // Draw some random values from the standard diff --git a/hplot/h1d_test.go b/hplot/h1d_test.go index 7a7ef6842..dc2659178 100644 --- a/hplot/h1d_test.go +++ b/hplot/h1d_test.go @@ -7,13 +7,13 @@ package hplot_test import ( "image/color" "math" + "math/rand/v2" "os" "runtime" "testing" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot/cmpimg" "gonum.org/v1/plot/vg" @@ -69,7 +69,7 @@ func TestH1DWithBorders(t *testing.T) { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } // Draw some random values from the standard diff --git a/hplot/h2d_example_test.go b/hplot/h2d_example_test.go index 661acf1d7..44b03bf58 100644 --- a/hplot/h2d_example_test.go +++ b/hplot/h2d_example_test.go @@ -6,10 +6,10 @@ package hplot_test import ( "log" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/mat" "gonum.org/v1/gonum/stat/distmv" "gonum.org/v1/plot/plotter" @@ -24,7 +24,7 @@ func ExampleH2D() { dist, ok := distmv.NewNormal( []float64{0, 1}, mat.NewSymDense(2, []float64{4, 0, 0, 2}), - rand.New(rand.NewSource(1234)), + rand.New(rand.NewPCG(1234, 1234)), ) if !ok { log.Fatalf("error creating distmv.Normal") @@ -59,7 +59,7 @@ func ExampleH2D_withLegend() { dist, ok := distmv.NewNormal( []float64{0, 1}, mat.NewSymDense(2, []float64{4, 0, 0, 2}), - rand.New(rand.NewSource(1234)), + rand.New(rand.NewPCG(1234, 1234)), ) if !ok { log.Fatalf("error creating distmv.Normal") diff --git a/hplot/hstack_example_test.go b/hplot/hstack_example_test.go index 2e0cc323c..372b78eb3 100644 --- a/hplot/hstack_example_test.go +++ b/hplot/hstack_example_test.go @@ -7,10 +7,10 @@ package hplot_test import ( "image/color" "log" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot" "gonum.org/v1/plot/vg" @@ -350,7 +350,7 @@ func fillH1(h *hbook.H1D, n int, mu, sigma float64, seed uint64) { dist := distuv.Normal{ Mu: mu, Sigma: sigma, - Src: rand.New(rand.NewSource(seed)), + Src: rand.New(rand.NewPCG(seed, seed)), } for i := 0; i < n; i++ { diff --git a/hplot/ratioplot_example_test.go b/hplot/ratioplot_example_test.go index ec1296b2e..10d9fcf1b 100644 --- a/hplot/ratioplot_example_test.go +++ b/hplot/ratioplot_example_test.go @@ -8,10 +8,10 @@ import ( "image/color" "log" "math" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot/vg" ) @@ -24,7 +24,7 @@ func ExampleRatioPlot() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } hist1 := hbook.NewH1D(20, -4, +4) diff --git a/hplot/s2d_example_test.go b/hplot/s2d_example_test.go index f9f96941c..cf719c308 100644 --- a/hplot/s2d_example_test.go +++ b/hplot/s2d_example_test.go @@ -7,10 +7,10 @@ package hplot_test import ( "image/color" "log" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/mat" "gonum.org/v1/gonum/stat/distmv" "gonum.org/v1/plot/plotter" @@ -26,7 +26,7 @@ func ExampleS2D() { dist, ok := distmv.NewNormal( []float64{0, 1}, mat.NewSymDense(2, []float64{4, 0, 0, 2}), - rand.New(rand.NewSource(1234)), + rand.New(rand.NewPCG(1234, 1234)), ) if !ok { log.Fatalf("error creating distmv.Normal") diff --git a/hplot/testdata/band_golden.png b/hplot/testdata/band_golden.png index 527863284..2d758cc30 100644 Binary files a/hplot/testdata/band_golden.png and b/hplot/testdata/band_golden.png differ diff --git a/hplot/testdata/binnederrband_fromh1d_golden.png b/hplot/testdata/binnederrband_fromh1d_golden.png index 2cb3a627f..741b2255e 100644 Binary files a/hplot/testdata/binnederrband_fromh1d_golden.png and b/hplot/testdata/binnederrband_fromh1d_golden.png differ diff --git a/hplot/testdata/diff_plot_golden.png b/hplot/testdata/diff_plot_golden.png index 09a384b7e..4b3126ec8 100644 Binary files a/hplot/testdata/diff_plot_golden.png and b/hplot/testdata/diff_plot_golden.png differ diff --git a/hplot/testdata/h1d_borders_golden.png b/hplot/testdata/h1d_borders_golden.png index b74dcd30e..5964f5d67 100644 Binary files a/hplot/testdata/h1d_borders_golden.png and b/hplot/testdata/h1d_borders_golden.png differ diff --git a/hplot/testdata/h1d_glyphs_golden.png b/hplot/testdata/h1d_glyphs_golden.png index 2c5fe369a..f8340852e 100644 Binary files a/hplot/testdata/h1d_glyphs_golden.png and b/hplot/testdata/h1d_glyphs_golden.png differ diff --git a/hplot/testdata/h1d_legend_golden.png b/hplot/testdata/h1d_legend_golden.png index 6a47e797d..15c975cf3 100644 Binary files a/hplot/testdata/h1d_legend_golden.png and b/hplot/testdata/h1d_legend_golden.png differ diff --git a/hplot/testdata/h1d_plot_golden.pdf b/hplot/testdata/h1d_plot_golden.pdf index 676dbf648..2c8e6459c 100644 Binary files a/hplot/testdata/h1d_plot_golden.pdf and b/hplot/testdata/h1d_plot_golden.pdf differ diff --git a/hplot/testdata/h1d_plot_golden.png b/hplot/testdata/h1d_plot_golden.png index d65d61025..38efc90c5 100644 Binary files a/hplot/testdata/h1d_plot_golden.png and b/hplot/testdata/h1d_plot_golden.png differ diff --git a/hplot/testdata/h1d_yerrs_band_golden.png b/hplot/testdata/h1d_yerrs_band_golden.png index b281cf870..b3f6ce350 100644 Binary files a/hplot/testdata/h1d_yerrs_band_golden.png and b/hplot/testdata/h1d_yerrs_band_golden.png differ diff --git a/hplot/testdata/h1d_yerrs_golden.png b/hplot/testdata/h1d_yerrs_golden.png index a6a9c528b..964255e65 100644 Binary files a/hplot/testdata/h1d_yerrs_golden.png and b/hplot/testdata/h1d_yerrs_golden.png differ diff --git a/hplot/testdata/h2d_plot_golden.png b/hplot/testdata/h2d_plot_golden.png index 92d031740..f05bfacce 100644 Binary files a/hplot/testdata/h2d_plot_golden.png and b/hplot/testdata/h2d_plot_golden.png differ diff --git a/hplot/testdata/h2d_plot_legend_golden.png b/hplot/testdata/h2d_plot_legend_golden.png index f8b2eb82e..76a4fdb44 100644 Binary files a/hplot/testdata/h2d_plot_legend_golden.png and b/hplot/testdata/h2d_plot_legend_golden.png differ diff --git a/hplot/testdata/hstack_band_golden.png b/hplot/testdata/hstack_band_golden.png index d5e30125c..2d2cc9395 100644 Binary files a/hplot/testdata/hstack_band_golden.png and b/hplot/testdata/hstack_band_golden.png differ diff --git a/hplot/testdata/hstack_golden.png b/hplot/testdata/hstack_golden.png index da5c4a2af..2aa5b71cc 100644 Binary files a/hplot/testdata/hstack_golden.png and b/hplot/testdata/hstack_golden.png differ diff --git a/hplot/testdata/hstack_logy_golden.png b/hplot/testdata/hstack_logy_golden.png index fcbb7ce36..6040e885f 100644 Binary files a/hplot/testdata/hstack_logy_golden.png and b/hplot/testdata/hstack_logy_golden.png differ diff --git a/hplot/testdata/latex_plot_golden.tex b/hplot/testdata/latex_plot_golden.tex index 7384c4e21..439d2ad70 100644 --- a/hplot/testdata/latex_plot_golden.tex +++ b/hplot/testdata/latex_plot_golden.tex @@ -192,39 +192,21 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{40.41455078125pt}{40.30859375pt}}]{{\fontsize{10pt}{10pt}\selectfont 0}} + \pgftext[base,at={\pgfpoint{34.85302734375pt}{76.27647048718745pt}}]{{\fontsize{10pt}{10pt}\selectfont 300}} \end{pgfscope} \begin{pgfscope} \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{34.85302734375pt}{103.91756800654083pt}}]{{\fontsize{10pt}{10pt}\selectfont 500}} + \pgftext[base,at={\pgfpoint{34.85302734375pt}{148.93884773403076pt}}]{{\fontsize{10pt}{10pt}\selectfont 900}} \end{pgfscope} \begin{pgfscope} \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{32.072265625pt}{167.52654226308167pt}}]{{\fontsize{10pt}{10pt}\selectfont 1000}} - \end{pgfscope} - - \begin{pgfscope} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{32.072265625pt}{231.1355165196225pt}}]{{\fontsize{10pt}{10pt}\selectfont 1500}} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{45.9736328125pt}{42.828125pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{42.828125pt}} - \pgfusepath{stroke} + \pgftext[base,at={\pgfpoint{32.072265625pt}{221.6012249808741pt}}]{{\fontsize{10pt}{10pt}\selectfont 1500}} \end{pgfscope} \begin{pgfscope} @@ -233,8 +215,8 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{45.9736328125pt}{106.43709925654083pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{106.43709925654083pt}} + \pgfpathmoveto{\pgfpoint{45.9736328125pt}{78.79600173718745pt}} + \pgflineto{\pgfpoint{53.9736328125pt}{78.79600173718745pt}} \pgfusepath{stroke} \end{pgfscope} @@ -244,8 +226,8 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{45.9736328125pt}{170.04607351308167pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{170.04607351308167pt}} + \pgfpathmoveto{\pgfpoint{45.9736328125pt}{151.45837898403076pt}} + \pgflineto{\pgfpoint{53.9736328125pt}{151.45837898403076pt}} \pgfusepath{stroke} \end{pgfscope} @@ -255,8 +237,8 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{45.9736328125pt}{233.6550477696225pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{233.6550477696225pt}} + \pgfpathmoveto{\pgfpoint{45.9736328125pt}{224.1207562308741pt}} + \pgflineto{\pgfpoint{53.9736328125pt}{224.1207562308741pt}} \pgfusepath{stroke} \end{pgfscope} @@ -266,8 +248,8 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{55.54991985130817pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{55.54991985130817pt}} + \pgfpathmoveto{\pgfpoint{49.9736328125pt}{115.1271903606091pt}} + \pgflineto{\pgfpoint{53.9736328125pt}{115.1271903606091pt}} \pgfusepath{stroke} \end{pgfscope} @@ -277,118 +259,8 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{68.27171470261634pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{68.27171470261634pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{80.9935095539245pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{80.9935095539245pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{93.71530440523267pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{93.71530440523267pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{119.15889410784901pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{119.15889410784901pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{131.88068895915717pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{131.88068895915717pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{144.60248381046534pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{144.60248381046534pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{157.3242786617735pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{157.3242786617735pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{182.76786836438984pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{182.76786836438984pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{195.48966321569802pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{195.48966321569802pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{208.21145806700616pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{208.21145806700616pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.5pt} - \color[rgb]{0,0,0} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{49.9736328125pt}{220.93325291831434pt}} - \pgflineto{\pgfpoint{53.9736328125pt}{220.93325291831434pt}} + \pgfpathmoveto{\pgfpoint{49.9736328125pt}{187.78956760745243pt}} + \pgflineto{\pgfpoint{53.9736328125pt}{187.78956760745243pt}} \pgfusepath{stroke} \end{pgfscope} @@ -413,62 +285,62 @@ \pgflineto{\pgfpoint{59.779296875pt}{42.828125pt}} \pgflineto{\pgfpoint{77.66113646499754pt}{42.828125pt}} \pgflineto{\pgfpoint{77.66113646499754pt}{42.828125pt}} - \pgflineto{\pgfpoint{77.66113646499754pt}{43.84586858810465pt}} - \pgflineto{\pgfpoint{95.54297605499508pt}{43.84586858810465pt}} - \pgflineto{\pgfpoint{95.54297605499508pt}{43.84586858810465pt}} - \pgflineto{\pgfpoint{95.54297605499508pt}{45.88135576431396pt}} - \pgflineto{\pgfpoint{113.42481564499263pt}{45.88135576431396pt}} - \pgflineto{\pgfpoint{113.42481564499263pt}{45.88135576431396pt}} - \pgflineto{\pgfpoint{113.42481564499263pt}{50.84285575632414pt}} - \pgflineto{\pgfpoint{131.30665523499016pt}{50.84285575632414pt}} - \pgflineto{\pgfpoint{131.30665523499016pt}{50.84285575632414pt}} - \pgflineto{\pgfpoint{131.30665523499016pt}{60.002548049266025pt}} - \pgflineto{\pgfpoint{149.18849482498769pt}{60.002548049266025pt}} - \pgflineto{\pgfpoint{149.18849482498769pt}{60.002548049266025pt}} - \pgflineto{\pgfpoint{149.18849482498769pt}{82.26568903905532pt}} - \pgflineto{\pgfpoint{167.07033441498527pt}{82.26568903905532pt}} - \pgflineto{\pgfpoint{167.07033441498527pt}{82.26568903905532pt}} - \pgflineto{\pgfpoint{167.07033441498527pt}{119.28611205636209pt}} - \pgflineto{\pgfpoint{184.9521740049828pt}{119.28611205636209pt}} - \pgflineto{\pgfpoint{184.9521740049828pt}{119.28611205636209pt}} - \pgflineto{\pgfpoint{184.9521740049828pt}{164.321265829993pt}} - \pgflineto{\pgfpoint{202.83401359498032pt}{164.321265829993pt}} - \pgflineto{\pgfpoint{202.83401359498032pt}{164.321265829993pt}} - \pgflineto{\pgfpoint{202.83401359498032pt}{212.66408626496403pt}} - \pgflineto{\pgfpoint{220.71585318497787pt}{212.66408626496403pt}} - \pgflineto{\pgfpoint{220.71585318497787pt}{212.66408626496403pt}} - \pgflineto{\pgfpoint{220.71585318497787pt}{238.99820160717195pt}} - \pgflineto{\pgfpoint{238.5976927749754pt}{238.99820160717195pt}} - \pgflineto{\pgfpoint{238.5976927749754pt}{238.99820160717195pt}} + \pgflineto{\pgfpoint{77.66113646499754pt}{43.31254084831229pt}} + \pgflineto{\pgfpoint{95.54297605499508pt}{43.31254084831229pt}} + \pgflineto{\pgfpoint{95.54297605499508pt}{43.31254084831229pt}} + \pgflineto{\pgfpoint{95.54297605499508pt}{44.76578839324915pt}} + \pgflineto{\pgfpoint{113.42481564499263pt}{44.76578839324915pt}} + \pgflineto{\pgfpoint{113.42481564499263pt}{44.76578839324915pt}} + \pgflineto{\pgfpoint{113.42481564499263pt}{49.3677389522159pt}} + \pgflineto{\pgfpoint{131.30665523499016pt}{49.3677389522159pt}} + \pgflineto{\pgfpoint{131.30665523499016pt}{49.3677389522159pt}} + \pgflineto{\pgfpoint{131.30665523499016pt}{56.87618460105637pt}} + \pgflineto{\pgfpoint{149.18849482498769pt}{56.87618460105637pt}} + \pgflineto{\pgfpoint{149.18849482498769pt}{56.87618460105637pt}} + \pgflineto{\pgfpoint{149.18849482498769pt}{78.19048192679708pt}} + \pgflineto{\pgfpoint{167.07033441498527pt}{78.19048192679708pt}} + \pgflineto{\pgfpoint{167.07033441498527pt}{78.19048192679708pt}} + \pgflineto{\pgfpoint{167.07033441498527pt}{119.72914091957584pt}} + \pgflineto{\pgfpoint{184.9521740049828pt}{119.72914091957584pt}} + \pgflineto{\pgfpoint{184.9521740049828pt}{119.72914091957584pt}} + \pgflineto{\pgfpoint{184.9521740049828pt}{162.47883953313533pt}} + \pgflineto{\pgfpoint{202.83401359498032pt}{162.47883953313533pt}} + \pgflineto{\pgfpoint{202.83401359498032pt}{162.47883953313533pt}} + \pgflineto{\pgfpoint{202.83401359498032pt}{201.71652324643074pt}} + \pgflineto{\pgfpoint{220.71585318497787pt}{201.71652324643074pt}} + \pgflineto{\pgfpoint{220.71585318497787pt}{201.71652324643074pt}} + \pgflineto{\pgfpoint{220.71585318497787pt}{239.37985545271118pt}} \pgflineto{\pgfpoint{238.5976927749754pt}{239.37985545271118pt}} - \pgflineto{\pgfpoint{256.47953236497295pt}{239.37985545271118pt}} - \pgflineto{\pgfpoint{256.47953236497295pt}{239.37985545271118pt}} - \pgflineto{\pgfpoint{256.47953236497295pt}{219.40663753615735pt}} - \pgflineto{\pgfpoint{274.36137195497054pt}{219.40663753615735pt}} - \pgflineto{\pgfpoint{274.36137195497054pt}{219.40663753615735pt}} - \pgflineto{\pgfpoint{274.36137195497054pt}{163.0490863448622pt}} - \pgflineto{\pgfpoint{292.24321154496806pt}{163.0490863448622pt}} - \pgflineto{\pgfpoint{292.24321154496806pt}{163.0490863448622pt}} - \pgflineto{\pgfpoint{292.24321154496806pt}{116.86897103461354pt}} - \pgflineto{\pgfpoint{310.1250511349656pt}{116.86897103461354pt}} - \pgflineto{\pgfpoint{310.1250511349656pt}{116.86897103461354pt}} - \pgflineto{\pgfpoint{310.1250511349656pt}{85.1917018548562pt}} - \pgflineto{\pgfpoint{328.0068907249631pt}{85.1917018548562pt}} - \pgflineto{\pgfpoint{328.0068907249631pt}{85.1917018548562pt}} - \pgflineto{\pgfpoint{328.0068907249631pt}{60.002548049266025pt}} - \pgflineto{\pgfpoint{345.88873031496064pt}{60.002548049266025pt}} - \pgflineto{\pgfpoint{345.88873031496064pt}{60.002548049266025pt}} - \pgflineto{\pgfpoint{345.88873031496064pt}{51.22450960186339pt}} - \pgflineto{\pgfpoint{363.7705699049582pt}{51.22450960186339pt}} - \pgflineto{\pgfpoint{363.7705699049582pt}{51.22450960186339pt}} - \pgflineto{\pgfpoint{363.7705699049582pt}{45.88135576431396pt}} - \pgflineto{\pgfpoint{381.65240949495575pt}{45.88135576431396pt}} - \pgflineto{\pgfpoint{381.65240949495575pt}{45.88135576431396pt}} - \pgflineto{\pgfpoint{381.65240949495575pt}{43.59143269107849pt}} - \pgflineto{\pgfpoint{399.5342490849533pt}{43.59143269107849pt}} - \pgflineto{\pgfpoint{399.5342490849533pt}{43.59143269107849pt}} - \pgflineto{\pgfpoint{399.5342490849533pt}{43.20977884553925pt}} - \pgflineto{\pgfpoint{417.4160886749508pt}{43.20977884553925pt}} + \pgflineto{\pgfpoint{238.5976927749754pt}{239.37985545271118pt}} + \pgflineto{\pgfpoint{238.5976927749754pt}{222.304196799703pt}} + \pgflineto{\pgfpoint{256.47953236497295pt}{222.304196799703pt}} + \pgflineto{\pgfpoint{256.47953236497295pt}{222.304196799703pt}} + \pgflineto{\pgfpoint{256.47953236497295pt}{203.5330826776018pt}} + \pgflineto{\pgfpoint{274.36137195497054pt}{203.5330826776018pt}} + \pgflineto{\pgfpoint{274.36137195497054pt}{203.5330826776018pt}} + \pgflineto{\pgfpoint{274.36137195497054pt}{156.42364142923174pt}} + \pgflineto{\pgfpoint{292.24321154496806pt}{156.42364142923174pt}} + \pgflineto{\pgfpoint{292.24321154496806pt}{156.42364142923174pt}} + \pgflineto{\pgfpoint{292.24321154496806pt}{117.67037356424862pt}} + \pgflineto{\pgfpoint{310.1250511349656pt}{117.67037356424862pt}} + \pgflineto{\pgfpoint{310.1250511349656pt}{117.67037356424862pt}} + \pgflineto{\pgfpoint{310.1250511349656pt}{80.37035324420239pt}} + \pgflineto{\pgfpoint{328.0068907249631pt}{80.37035324420239pt}} + \pgflineto{\pgfpoint{328.0068907249631pt}{80.37035324420239pt}} + \pgflineto{\pgfpoint{328.0068907249631pt}{60.63040742547661pt}} + \pgflineto{\pgfpoint{345.88873031496064pt}{60.63040742547661pt}} + \pgflineto{\pgfpoint{345.88873031496064pt}{60.63040742547661pt}} + \pgflineto{\pgfpoint{345.88873031496064pt}{50.215466686762404pt}} + \pgflineto{\pgfpoint{363.7705699049582pt}{50.215466686762404pt}} + \pgflineto{\pgfpoint{363.7705699049582pt}{50.215466686762404pt}} + \pgflineto{\pgfpoint{363.7705699049582pt}{44.52358046909301pt}} + \pgflineto{\pgfpoint{381.65240949495575pt}{44.52358046909301pt}} + \pgflineto{\pgfpoint{381.65240949495575pt}{44.52358046909301pt}} + \pgflineto{\pgfpoint{381.65240949495575pt}{42.828125pt}} + \pgflineto{\pgfpoint{399.5342490849533pt}{42.828125pt}} + \pgflineto{\pgfpoint{399.5342490849533pt}{42.828125pt}} + \pgflineto{\pgfpoint{399.5342490849533pt}{42.949228962078074pt}} + \pgflineto{\pgfpoint{417.4160886749508pt}{42.949228962078074pt}} \pgflineto{\pgfpoint{417.4160886749508pt}{42.828125pt}} \pgfusepath{stroke} \end{pgfscope} @@ -477,7 +349,7 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{344.0030027374508pt}{229.15524607771118pt}}]{{\fontsize{10pt}{10pt}\selectfont Entries}} + \pgftext[base,at={\pgfpoint{332.8799558624508pt}{229.15524607771118pt}}]{{\fontsize{10pt}{10pt}\selectfont Entries}} \end{pgfscope} \begin{pgfscope} @@ -491,28 +363,28 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{340.9488035187008pt}{217.98337107771118pt}}]{{\fontsize{10pt}{10pt}\selectfont Mean}} + \pgftext[base,at={\pgfpoint{329.8257566437008pt}{217.98337107771118pt}}]{{\fontsize{10pt}{10pt}\selectfont Mean}} \end{pgfscope} \begin{pgfscope} \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{395.1724363312008pt}{217.98337107771118pt}}]{{\fontsize{10pt}{10pt}\selectfont 0.004393 }} + \pgftext[base,at={\pgfpoint{392.3916746124508pt}{217.98337107771118pt}}]{{\fontsize{10pt}{10pt}\selectfont 0.0009055 }} \end{pgfscope} \begin{pgfscope} \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{346.2271238312008pt}{206.81149607771118pt}}]{{\fontsize{10pt}{10pt}\selectfont Std Dev}} + \pgftext[base,at={\pgfpoint{335.1040769562008pt}{206.81149607771118pt}}]{{\fontsize{10pt}{10pt}\selectfont Std Dev}} \end{pgfscope} \begin{pgfscope} \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgftext[base,at={\pgfpoint{402.1255613312008pt}{206.81149607771118pt}}]{{\fontsize{10pt}{10pt}\selectfont 1.005 }} + \pgftext[base,at={\pgfpoint{400.7339597687008pt}{206.81149607771118pt}}]{{\fontsize{10pt}{10pt}\selectfont 0.9996 }} \end{pgfscope} \begin{pgfscope} @@ -521,11 +393,11 @@ \color[rgb]{0,0,0} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{325.6631589874508pt}{239.37985545271118pt}} - \pgflineto{\pgfpoint{325.6631589874508pt}{205.86423045271118pt}} + \pgfpathmoveto{\pgfpoint{314.5401121124508pt}{239.37985545271118pt}} + \pgflineto{\pgfpoint{314.5401121124508pt}{205.86423045271118pt}} \pgflineto{\pgfpoint{417.4160886749508pt}{205.86423045271118pt}} \pgflineto{\pgfpoint{417.4160886749508pt}{239.37985545271118pt}} - \pgflineto{\pgfpoint{325.6631589874508pt}{239.37985545271118pt}} + \pgflineto{\pgfpoint{314.5401121124508pt}{239.37985545271118pt}} \pgfusepath{stroke} \end{pgfscope} @@ -568,19 +440,8 @@ \color[rgb]{0.5019607843137255,0.5019607843137255,0.5019607843137255} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{59.779296875pt}{42.828125pt}} - \pgflineto{\pgfpoint{417.4160886749508pt}{42.828125pt}} - \pgfusepath{stroke} - \end{pgfscope} - - \begin{pgfscope} - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.25pt} - \color[rgb]{0.5019607843137255,0.5019607843137255,0.5019607843137255} - \pgfsetstrokeopacity{1} - \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{59.779296875pt}{106.43709925654083pt}} - \pgflineto{\pgfpoint{417.4160886749508pt}{106.43709925654083pt}} + \pgfpathmoveto{\pgfpoint{59.779296875pt}{78.79600173718745pt}} + \pgflineto{\pgfpoint{417.4160886749508pt}{78.79600173718745pt}} \pgfusepath{stroke} \end{pgfscope} @@ -590,8 +451,8 @@ \color[rgb]{0.5019607843137255,0.5019607843137255,0.5019607843137255} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{59.779296875pt}{170.04607351308167pt}} - \pgflineto{\pgfpoint{417.4160886749508pt}{170.04607351308167pt}} + \pgfpathmoveto{\pgfpoint{59.779296875pt}{151.45837898403076pt}} + \pgflineto{\pgfpoint{417.4160886749508pt}{151.45837898403076pt}} \pgfusepath{stroke} \end{pgfscope} @@ -601,8 +462,8 @@ \color[rgb]{0.5019607843137255,0.5019607843137255,0.5019607843137255} \pgfsetstrokeopacity{1} \pgfsetfillopacity{1} - \pgfpathmoveto{\pgfpoint{59.779296875pt}{233.6550477696225pt}} - \pgflineto{\pgfpoint{417.4160886749508pt}{233.6550477696225pt}} + \pgfpathmoveto{\pgfpoint{59.779296875pt}{224.1207562308741pt}} + \pgflineto{\pgfpoint{417.4160886749508pt}{224.1207562308741pt}} \pgfusepath{stroke} \end{pgfscope} diff --git a/hplot/testdata/s2d_golden.png b/hplot/testdata/s2d_golden.png index ccea1629d..470c5bb8a 100644 Binary files a/hplot/testdata/s2d_golden.png and b/hplot/testdata/s2d_golden.png differ diff --git a/hplot/testdata/sub_plot_golden.png b/hplot/testdata/sub_plot_golden.png index af75c4481..832e23039 100644 Binary files a/hplot/testdata/sub_plot_golden.png and b/hplot/testdata/sub_plot_golden.png differ diff --git a/hplot/testdata/tiled_plot_histogram_golden.png b/hplot/testdata/tiled_plot_histogram_golden.png index 8203348b6..c17977e7e 100644 Binary files a/hplot/testdata/tiled_plot_histogram_golden.png and b/hplot/testdata/tiled_plot_histogram_golden.png differ diff --git a/hplot/tiledplot_example_test.go b/hplot/tiledplot_example_test.go index 834753202..0fa649938 100644 --- a/hplot/tiledplot_example_test.go +++ b/hplot/tiledplot_example_test.go @@ -9,10 +9,10 @@ import ( "image/color" "log" "math" + "math/rand/v2" "go-hep.org/x/hep/hbook" "go-hep.org/x/hep/hplot" - "golang.org/x/exp/rand" "gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/plot/vg" "gonum.org/v1/plot/vg/draw" @@ -26,7 +26,7 @@ func ExampleTiledPlot() { dist := distuv.Normal{ Mu: 0, Sigma: 1, - Src: rand.New(rand.NewSource(0)), + Src: rand.New(rand.NewPCG(0, 0)), } newHist := func(p *hplot.Plot) {