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

Method DataCanvas

plot.go:182–193  ·  view source on GitHub ↗

DataCanvas returns a new draw.Canvas that is the subset of the given draw area into which the plot data will be drawn.

(da draw.Canvas)

Source from the content-addressed store, hash-verified

180// is the subset of the given draw area into which
181// the plot data will be drawn.
182func (p *Plot) DataCanvas(da draw.Canvas) draw.Canvas {
183 if p.Title.Text != "" {
184 rect := p.Title.TextStyle.Rectangle(p.Title.Text)
185 da.Max.Y -= rect.Size().Y
186 da.Max.Y -= p.Title.Padding
187 }
188 p.X.sanitizeRange()
189 x := horizontalAxis{p.X}
190 p.Y.sanitizeRange()
191 y := verticalAxis{p.Y}
192 return padY(p, padX(p, draw.Crop(da, y.size(), 0, x.size(), 0)))
193}
194
195// DrawGlyphBoxes draws red outlines around the plot's
196// GlyphBoxes. This is intended for debugging.

Callers 3

DrawGlyphBoxesMethod · 0.95
AlignFunction · 0.80

Calls 8

sizeMethod · 0.95
sizeMethod · 0.95
CropFunction · 0.92
padYFunction · 0.85
padXFunction · 0.85
sanitizeRangeMethod · 0.80
SizeMethod · 0.65
RectangleMethod · 0.45

Tested by 1