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

Method GlyphBoxes

plotter/contour.go:268–284  ·  view source on GitHub ↗

GlyphBoxes implements the GlyphBoxes method of the plot.GlyphBoxer interface.

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

266// GlyphBoxes implements the GlyphBoxes method
267// of the plot.GlyphBoxer interface.
268func (h *Contour) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {
269 c, r := h.GridXYZ.Dims()
270 b := make([]plot.GlyphBox, 0, r*c)
271 for i := range c {
272 for j := range r {
273 b = append(b, plot.GlyphBox{
274 X: plt.X.Norm(h.GridXYZ.X(i)),
275 Y: plt.Y.Norm(h.GridXYZ.Y(j)),
276 Rectangle: vg.Rectangle{
277 Min: vg.Point{X: -2.5, Y: -2.5},
278 Max: vg.Point{X: +2.5, Y: +2.5},
279 },
280 })
281 }
282 }
283 return b
284}
285
286// isLoop returns true iff a vg.Path is a closed loop.
287func isLoop(p vg.Path) bool {

Callers

nothing calls this directly

Calls 4

NormMethod · 0.80
DimsMethod · 0.65
XMethod · 0.65
YMethod · 0.65

Tested by

no test coverage detected