MCPcopy Create free account
hub / github.com/gonum/plot / ExampleHeatMap_rasterized

Function ExampleHeatMap_rasterized

plotter/heat_rasterized_example_test.go:16–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func ExampleHeatMap_rasterized() {
17 m := offsetUnitGrid{
18 XOffset: -2,
19 YOffset: -1,
20 Data: mat.NewDense(3, 4, []float64{
21 1, 2, 3, 4,
22 5, 6, 7, 8,
23 9, 10, 11, 12,
24 })}
25
26 pal := palette.Heat(12, 1)
27 plt := plot.New()
28
29 raster := plotter.NewHeatMap(&m, pal)
30 raster.Rasterized = true
31 plt.Add(raster)
32
33 err := plt.Save(250, 175, "testdata/rasterHeatMap.png")
34 if err != nil {
35 log.Panic(err)
36 }
37}

Callers

nothing calls this directly

Calls 5

HeatFunction · 0.92
NewFunction · 0.92
NewHeatMapFunction · 0.92
SaveMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected