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

Method OutsideLabels

plotter/quartile.go:260–275  ·  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 plot.

(labels Labeller)

Source from the content-addressed store, hash-verified

258// labels are assumed to correspond to the
259// points used to create the plot.
260func (b *horizQuartPlot) OutsideLabels(labels Labeller) (*Labels, error) {
261 strs := make([]string, len(b.Outside))
262 for i, out := range b.Outside {
263 strs[i] = labels.Label(out)
264 }
265 o := horizQuartPlotOutsideLabels{
266 quartPlotOutsideLabels{b.QuartPlot, strs},
267 }
268 ls, err := NewLabels(o)
269 if err != nil {
270 return nil, err
271 }
272 off := 0.5 * b.MedianStyle.Radius
273 ls.Offset = ls.Offset.Add(vg.Point{X: off, Y: off})
274 return ls, nil
275}
276
277type horizQuartPlotOutsideLabels struct {
278 quartPlotOutsideLabels

Callers

nothing calls this directly

Calls 3

NewLabelsFunction · 0.85
LabelMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected