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

Method GlyphBoxes

plotter/boxplot.go:264–283  ·  view source on GitHub ↗

GlyphBoxes returns a slice of GlyphBoxes for the points and for the median line of the boxplot, implementing the plot.GlyphBoxer interface

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

262// points and for the median line of the boxplot,
263// implementing the plot.GlyphBoxer interface
264func (b *BoxPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {
265 if b.Horizontal {
266 b := &horizBoxPlot{b}
267 return b.GlyphBoxes(plt)
268 }
269
270 bs := make([]plot.GlyphBox, len(b.Outside)+1)
271 for i, out := range b.Outside {
272 bs[i].X = plt.X.Norm(b.Location)
273 bs[i].Y = plt.Y.Norm(b.Value(out))
274 bs[i].Rectangle = b.GlyphStyle.Rectangle()
275 }
276 bs[len(bs)-1].X = plt.X.Norm(b.Location)
277 bs[len(bs)-1].Y = plt.Y.Norm(b.Median)
278 bs[len(bs)-1].Rectangle = vg.Rectangle{
279 Min: vg.Point{X: b.Offset - (b.Width/2 + b.BoxStyle.Width/2)},
280 Max: vg.Point{X: b.Offset + (b.Width/2 + b.BoxStyle.Width/2)},
281 }
282 return bs
283}
284
285// OutsideLabels returns a *Labels that will plot
286// a label for each of the outside points. The

Callers

nothing calls this directly

Calls 3

NormMethod · 0.80
ValueMethod · 0.65
RectangleMethod · 0.45

Tested by

no test coverage detected