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)
| 262 | // points and for the median line of the boxplot, |
| 263 | // implementing the plot.GlyphBoxer interface |
| 264 | func (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 |