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

Method OutsideLabels

plotter/boxplot.go:412–427  ·  view source on GitHub ↗

OutsideLabels returns a *Labels that will plot a label for each of the outside points. The labels are assumed to correspond to the points used to create the box plot.

(labels Labeller)

Source from the content-addressed store, hash-verified

410// labels are assumed to correspond to the
411// points used to create the box plot.
412func (b *horizBoxPlot) OutsideLabels(labels Labeller) (*Labels, error) {
413 strs := make([]string, len(b.Outside))
414 for i, out := range b.Outside {
415 strs[i] = labels.Label(out)
416 }
417 o := horizBoxPlotOutsideLabels{
418 boxPlotOutsideLabels{b.BoxPlot, strs},
419 }
420 ls, err := NewLabels(o)
421 if err != nil {
422 return nil, err
423 }
424 off := 0.5 * b.GlyphStyle.Radius
425 ls.Offset = ls.Offset.Add(vg.Point{X: off, Y: off})
426 return ls, nil
427}
428
429type horizBoxPlotOutsideLabels struct {
430 boxPlotOutsideLabels

Callers

nothing calls this directly

Calls 3

NewLabelsFunction · 0.85
LabelMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected