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

Method DataRange

plotter/polygon.go:95–109  ·  view source on GitHub ↗

DataRange returns the minimum and maximum x and y values, implementing the plot.DataRanger interface.

()

Source from the content-addressed store, hash-verified

93// x and y values, implementing the plot.DataRanger
94// interface.
95func (pts *Polygon) DataRange() (xmin, xmax, ymin, ymax float64) {
96 xmin = math.Inf(1)
97 xmax = math.Inf(-1)
98 ymin = math.Inf(1)
99 ymax = math.Inf(-1)
100 for _, ring := range pts.XYs {
101 xmini, xmaxi := Range(XValues{ring})
102 ymini, ymaxi := Range(YValues{ring})
103 xmin = math.Min(xmin, xmini)
104 xmax = math.Max(xmax, xmaxi)
105 ymin = math.Min(ymin, ymini)
106 ymax = math.Max(ymax, ymaxi)
107 }
108 return
109}
110
111// Thumbnail creates the thumbnail for the Polygon,
112// implementing the plot.Thumbnailer interface.

Callers

nothing calls this directly

Calls 3

RangeFunction · 0.85
MinMethod · 0.65
MaxMethod · 0.65

Tested by

no test coverage detected