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

Method GlyphBoxes

plotter/quartile.go:132–153  ·  view source on GitHub ↗

GlyphBoxes returns a slice of GlyphBoxes for the plot, implementing the plot.GlyphBoxer interface.

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

130// GlyphBoxes returns a slice of GlyphBoxes for the plot,
131// implementing the plot.GlyphBoxer interface.
132func (b *QuartPlot) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {
133 if b.Horizontal {
134 b := &horizQuartPlot{b}
135 return b.GlyphBoxes(plt)
136 }
137
138 bs := make([]plot.GlyphBox, len(b.Outside)+1)
139
140 ostyle := b.MedianStyle
141 ostyle.Radius = b.MedianStyle.Radius / 2
142 for i, out := range b.Outside {
143 bs[i].X = plt.X.Norm(b.Location)
144 bs[i].Y = plt.Y.Norm(b.Value(out))
145 bs[i].Rectangle = ostyle.Rectangle()
146 bs[i].Rectangle.Min.X += b.Offset
147 }
148 bs[len(bs)-1].X = plt.X.Norm(b.Location)
149 bs[len(bs)-1].Y = plt.Y.Norm(b.Median)
150 bs[len(bs)-1].Rectangle = b.MedianStyle.Rectangle()
151 bs[len(bs)-1].Rectangle.Min.X += b.Offset
152 return bs
153}
154
155// OutsideLabels returns a *Labels that will plot
156// 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