func NewLabel(x, y float64, txt string, opts ...LabelOption) *Label {

	style := draw.TextStyle{
		Color: color.Black,
		Font:  DefaultStyle.Fonts.Tick, // FIXME(sbinet): add a field in Style?
	}

	cfg := &labelConfig{
		TextStyle: style,
	}

	for _, opt := range opts {
		opt(cfg)
	}

	if cfg.Normalized {
		if !(0 <= x && x <= 1) {
			panic(fmt.Errorf(
				"hplot: normalized label x-position is outside [0,1]: %g", x,
			))
		}
		if !(0 <= y && y <= 1) {
			panic(fmt.Errorf(
				"hplot: normalized label y-position is outside [0,1]: %g", y,
			))
		}
	}

	return &Label{
		Text:       txt,
		X:          x,
		Y:          y,
		TextStyle:  cfg.TextStyle,
		Normalized: cfg.Normalized,
		AutoAdjust: cfg.AutoAdjust,
	}
}
// NewLabel creates a new txt label at position (x, y).
NewLabel creates a new txt label at position (x, y).
// NewLabel creates a new txt label at position ( x y ) .
func NewLabel(x, y float64, txt string, opts ...LabelOption) *Label {
	style := draw.TextStyle{
		Color: color.Black,
		Font:  DefaultStyle.Fonts.Tick, 
	}
	cfg := &labelConfig{
		TextStyle: style,
	}
	for _, opt := range opts {
		opt(cfg)
	}
	if cfg.Normalized {
		if !(0 <= x && x <= 1) {
			panic(fmt.Errorf(
				"hplot: normalized label x-position is outside [0,1]: %g", x,
			))
		}
		if !(0 <= y && y <= 1) {
			panic(fmt.Errorf(
				"hplot: normalized label y-position is outside [0,1]: %g", y,
			))
		}
	}
	return &Label{
		Text:       txt,
		X:          x,
		Y:          y,
		TextStyle:  cfg.TextStyle,
		Normalized: cfg.Normalized,
		AutoAdjust: cfg.AutoAdjust,
	}
}
func NewLabel ( x , y float64 , txt string , opts ... LabelOption ) * Label { style := draw . TextStyle { Color : color . Black , Font : DefaultStyle . Fonts . Tick , } cfg := & labelConfig { TextStyle : style , } for _ , opt := range opts { opt ( cfg ) } if cfg . Normalized { if ! ( 0 <= x && x <= 1 ) { panic ( fmt . Errorf ( " " , x , ) ) } if ! ( 0 <= y && y <= 1 ) { panic ( fmt . Errorf ( " " , y , ) ) } } return & Label { Text : txt , X : x , Y : y , TextStyle : cfg . TextStyle , Normalized : cfg . Normalized , AutoAdjust : cfg . AutoAdjust , } }
NewLabel creates a new txt label at position (x, y).
NewLabel creates a new txt label at position ( x y ) .
// FIXME(sbinet): add a field in Style?