MCPcopy Create free account
hub / github.com/cogentcore/core / UpdateRangeFromPlotter

Method UpdateRangeFromPlotter

plot/plot.go:199–207  ·  view source on GitHub ↗
(d Plotter)

Source from the content-addressed store, hash-verified

197}
198
199func (pt *Plot) UpdateRangeFromPlotter(d Plotter) {
200 if x, ok := d.(DataRanger); ok {
201 xmin, xmax, ymin, ymax := x.DataRange()
202 pt.X.Min = math32.Min(pt.X.Min, xmin)
203 pt.X.Max = math32.Max(pt.X.Max, xmax)
204 pt.Y.Min = math32.Min(pt.Y.Min, ymin)
205 pt.Y.Max = math32.Max(pt.Y.Max, ymax)
206 }
207}
208
209// PX returns the X-axis plotting coordinate for given raw data value
210// using the current plot bounding region

Callers 2

AddMethod · 0.95
UpdateRangeMethod · 0.95

Calls 3

MinFunction · 0.92
MaxFunction · 0.92
DataRangeMethod · 0.65

Tested by

no test coverage detected