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)
| 390 | // points and for the median line of the boxplot, |
| 391 | // implementing the plot.GlyphBoxer interface |
| 392 | func (b horizBoxPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { |
| 393 | bs := make([]plot.GlyphBox, len(b.Outside)+1) |
| 394 | for i, out := range b.Outside { |
| 395 | bs[i].X = plt.X.Norm(b.Value(out)) |
| 396 | bs[i].Y = plt.Y.Norm(b.Location) |
| 397 | bs[i].Rectangle = b.GlyphStyle.Rectangle() |
| 398 | } |
| 399 | bs[len(bs)-1].X = plt.X.Norm(b.Median) |
| 400 | bs[len(bs)-1].Y = plt.Y.Norm(b.Location) |
| 401 | bs[len(bs)-1].Rectangle = vg.Rectangle{ |
| 402 | Min: vg.Point{Y: b.Offset - (b.Width/2 + b.BoxStyle.Width/2)}, |
| 403 | Max: vg.Point{Y: b.Offset + (b.Width/2 + b.BoxStyle.Width/2)}, |
| 404 | } |
| 405 | return bs |
| 406 | } |
| 407 | |
| 408 | // OutsideLabels returns a *Labels that will plot |
| 409 | // a label for each of the outside points. The |