MCPcopy Index your code
hub / github.com/gonum/plot / TestAxisPadding

Function TestAxisPadding

axis_test.go:155–174  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

153}
154
155func TestAxisPadding(t *testing.T) {
156 for _, padding := range []int{0, 5, 10} {
157 t.Run(fmt.Sprintf("padding-%d", padding), func(t *testing.T) {
158 cmpimg.CheckPlot(func() {
159 p := New()
160 p.Title.Text = fmt.Sprintf("padding=%d", padding)
161 p.X.Label.Text = "X-Axis"
162 p.X.Label.Padding = vg.Points(float64(padding))
163 p.Y.Label.Text = "Y-Axis"
164 p.Y.Label.Padding = vg.Points(float64(padding))
165
166 const size = 5 * vg.Centimeter
167 err := p.Save(size, size, fmt.Sprintf("testdata/axis_padding_%02d.png", padding))
168 if err != nil {
169 t.Fatalf("error: %+v", err)
170 }
171 }, t, fmt.Sprintf("axis_padding_%02d.png", padding))
172 })
173 }
174}

Callers

nothing calls this directly

Calls 4

CheckPlotFunction · 0.92
PointsFunction · 0.92
SaveMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected