...

Source file src/gonum.org/v1/plot/vg/draw/split_horiz_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  // SplitHorizontal returns the left and right portions of c after splitting it
    13  // along a vertical line distance x from the left of c.
    14  func SplitHorizontal(c draw.Canvas, x vg.Length) (left, right draw.Canvas) {
    15  	return draw.Crop(c, 0, c.Min.X-c.Max.X+x, 0, 0), draw.Crop(c, x, 0, 0, 0)
    16  }
    17  

View as plain text