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

Function ExampleCrop_splitVertical

vg/draw/split_vertical_example_test.go:15–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13)
14
15func ExampleCrop_splitVertical() {
16 c := draw.New(vgimg.New(vg.Points(10), vg.Points(16)))
17
18 // Split c along a horizontal line centered on the canvas.
19 bottom, top := SplitVertical(c, c.Size().Y/2)
20 fmt.Printf("top: %#v\n", top.Rectangle)
21 fmt.Printf("bottom: %#v\n", bottom.Rectangle)
22
23 // Output:
24 // top: vg.Rectangle{Min:vg.Point{X:0, Y:8}, Max:vg.Point{X:10, Y:16}}
25 // bottom: vg.Rectangle{Min:vg.Point{X:0, Y:0}, Max:vg.Point{X:10, Y:8}}
26}

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
NewFunction · 0.92
PointsFunction · 0.92
SplitVerticalFunction · 0.85
SizeMethod · 0.65

Tested by

no test coverage detected