func NewGraphErrorsFrom(s2 *hbook.S2D) GraphErrors {
	var (
		n     = s2.Len()
		groot = newGraphErrs(n)
		ymin  = +math.MaxFloat64
		ymax  = -math.MaxFloat64
	)

	for i, pt := range s2.Points() {
		groot.x[i] = pt.X
		groot.xerr[i] = pt.ErrX.Min
		groot.y[i] = pt.Y
		groot.yerr[i] = pt.ErrY.Min

		ymax = math.Max(ymax, pt.Y)
		ymin = math.Min(ymin, pt.Y)
	}

	groot.tgraph.named.SetName(s2.Name())
	if v, ok := s2.Annotation()["title"]; ok {
		groot.tgraph.named.SetTitle(v.(string))
	}

	groot.min = ymin
	groot.max = ymax

	return groot
}
// NewGraphErrorsFrom creates a new GraphErrors from 2-dim hbook data points.
NewGraphErrorsFrom creates a new GraphErrors from 2-dim hbook data points.
// NewGraphErrorsFrom creates a new GraphErrors from 2 - dim hbook data points .
func NewGraphErrorsFrom(s2 *hbook.S2D) GraphErrors {
	var (
		n     = s2.Len()
		groot = newGraphErrs(n)
		ymin  = +math.MaxFloat64
		ymax  = -math.MaxFloat64
	)
	for i, pt := range s2.Points() {
		groot.x[i] = pt.X
		groot.xerr[i] = pt.ErrX.Min
		groot.y[i] = pt.Y
		groot.yerr[i] = pt.ErrY.Min
		ymax = math.Max(ymax, pt.Y)
		ymin = math.Min(ymin, pt.Y)
	}
	groot.tgraph.named.SetName(s2.Name())
	if v, ok := s2.Annotation()["title"]; ok {
		groot.tgraph.named.SetTitle(v.(string))
	}
	groot.min = ymin
	groot.max = ymax
	return groot
}
func NewGraphErrorsFrom ( s2 * hbook . S2D ) GraphErrors { var ( n = s2 . Len ( ) groot = newGraphErrs ( n ) ymin = + math . MaxFloat64 ymax = - math . MaxFloat64 ) for i , pt := range s2 . Points ( ) { groot . x [ i ] = pt . X groot . xerr [ i ] = pt . ErrX . Min groot . y [ i ] = pt . Y groot . yerr [ i ] = pt . ErrY . Min ymax = math . Max ( ymax , pt . Y ) ymin = math . Min ( ymin , pt . Y ) } groot . tgraph . named . SetName ( s2 . Name ( ) ) if v , ok := s2 . Annotation ( ) [ " " ] ; ok { groot . tgraph . named . SetTitle ( v . ( string ) ) } groot . min = ymin groot . max = ymax return groot }
NewGraphErrorsFrom creates a new GraphErrors from 2-dim hbook data points.
NewGraphErrorsFrom creates a new GraphErrors from 2 - dim hbook data points .