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

Method Plot

plotter/quartile.go:199–227  ·  view source on GitHub ↗
(c draw.Canvas, plt *plot.Plot)

Source from the content-addressed store, hash-verified

197type horizQuartPlot struct{ *QuartPlot }
198
199func (b horizQuartPlot) Plot(c draw.Canvas, plt *plot.Plot) {
200 trX, trY := plt.Transforms(&c)
201 y := trY(b.Location)
202 if !c.ContainsY(y) {
203 return
204 }
205 y += b.Offset
206
207 med := vg.Point{X: trX(b.Median), Y: y}
208 q1 := trX(b.Quartile1)
209 q3 := trX(b.Quartile3)
210 aLow := trX(b.AdjLow)
211 aHigh := trX(b.AdjHigh)
212
213 c.StrokeLine2(b.WhiskerStyle, aHigh, y, q3, y)
214 if c.ContainsX(med.X) {
215 c.DrawGlyphNoClip(b.MedianStyle, med)
216 }
217 c.StrokeLine2(b.WhiskerStyle, aLow, y, q1, y)
218
219 ostyle := b.MedianStyle
220 ostyle.Radius = b.MedianStyle.Radius / 2
221 for _, out := range b.Outside {
222 x := trX(b.Value(out))
223 if c.ContainsX(x) {
224 c.DrawGlyphNoClip(ostyle, vg.Point{X: x, Y: y})
225 }
226 }
227}
228
229// DataRange returns the minimum and maximum x
230// and y values, implementing the plot.DataRanger

Callers

nothing calls this directly

Calls 6

TransformsMethod · 0.80
ContainsYMethod · 0.80
StrokeLine2Method · 0.80
ContainsXMethod · 0.80
DrawGlyphNoClipMethod · 0.80
ValueMethod · 0.65

Tested by

no test coverage detected