MCPcopy Create free account
hub / github.com/gonum/plot / size

Method size

axis.go:236–253  ·  view source on GitHub ↗

size returns the height of the axis.

()

Source from the content-addressed store, hash-verified

234
235// size returns the height of the axis.
236func (a horizontalAxis) size() (h vg.Length) {
237 if a.Label.Text != "" { // We assume that the label isn't rotated.
238 h += a.Label.TextStyle.Height(a.Label.Text)
239 h += a.Label.Padding
240 }
241
242 marks := a.Tick.Marker.Ticks(a.Min, a.Max)
243 if len(marks) > 0 {
244 if a.drawTicks() {
245 h += a.Tick.Length
246 }
247 h += tickLabelHeight(a.Tick.Label, marks)
248 }
249 h += a.Width / 2
250 h += a.Padding
251
252 return h
253}
254
255// draw draws the axis along the lower edge of a draw.Canvas.
256func (a horizontalAxis) draw(c draw.Canvas) {

Callers 3

DrawMethod · 0.95
DataCanvasMethod · 0.95
DrawGlyphBoxesMethod · 0.95

Calls 4

tickLabelHeightFunction · 0.85
HeightMethod · 0.80
drawTicksMethod · 0.80
TicksMethod · 0.65

Tested by

no test coverage detected