...

Source file src/gonum.org/v1/plot/vg/draw/split_vertical_test.go

Documentation: gonum.org/v1/plot/vg/draw

     1  // Copyright ©2017 The Gonum Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package draw_test
     6  
     7  import (
     8  	"gonum.org/v1/plot/vg"
     9  	"gonum.org/v1/plot/vg/draw"
    10  )
    11  
    12  // SplitVertical returns the lower and upper portions of c after
    13  // splitting it along a horizontal line distance y from the
    14  // bottom of c.
    15  func SplitVertical(c draw.Canvas, y vg.Length) (lower, upper draw.Canvas) {
    16  	return draw.Crop(c, 0, 0, 0, c.Min.Y-c.Max.Y+y), draw.Crop(c, 0, 0, y, 0)
    17  }
    18  

View as plain text