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

Method Thumbnail

plotter/histogram.go:158–175  ·  view source on GitHub ↗

Thumbnail draws a rectangle in the given style of the histogram.

(c *draw.Canvas)

Source from the content-addressed store, hash-verified

156
157// Thumbnail draws a rectangle in the given style of the histogram.
158func (h *Histogram) Thumbnail(c *draw.Canvas) {
159 ymin := c.Min.Y
160 ymax := c.Max.Y
161 xmin := c.Min.X
162 xmax := c.Max.X
163
164 pts := []vg.Point{
165 {X: xmin, Y: ymin},
166 {X: xmax, Y: ymin},
167 {X: xmax, Y: ymax},
168 {X: xmin, Y: ymax},
169 }
170 if h.FillColor != nil {
171 c.FillPolygon(h.FillColor, c.ClipPolygonXY(pts))
172 }
173 pts = append(pts, vg.Point{X: xmin, Y: ymin})
174 c.StrokeLines(h.LineStyle, c.ClipLinesXY(pts)...)
175}
176
177// binPoints returns a slice containing the
178// given number of bins, and the width of

Callers

nothing calls this directly

Calls 4

FillPolygonMethod · 0.80
ClipPolygonXYMethod · 0.80
StrokeLinesMethod · 0.80
ClipLinesXYMethod · 0.80

Tested by

no test coverage detected