MCPcopy Index your code
hub / github.com/bqplot/bqplot / _set_label

Function _set_label

bqplot/pyplot.py:368–385  ·  view source on GitHub ↗

Helper function to set labels for an axis

(label, mark, dim, **kwargs)

Source from the content-addressed store, hash-verified

366
367
368def _set_label(label, mark, dim, **kwargs):
369 """Helper function to set labels for an axis
370 """
371 if mark is None:
372 mark = _context['last_mark']
373 if mark is None:
374 return {}
375 fig = kwargs.get('figure', current_figure())
376 scales = mark.scales
377 scale_metadata = mark.scales_metadata.get(dim, {})
378 scale = scales.get(dim, None)
379 if scale is None:
380 return
381 dimension = scale_metadata.get('dimension', scales[dim])
382 axis = _fetch_axis(fig, dimension, scales[dim])
383
384 if axis is not None:
385 _apply_properties(axis, {'label': label})
386
387
388def xlabel(label=None, mark=None, **kwargs):

Callers 2

xlabelFunction · 0.85
ylabelFunction · 0.85

Calls 3

current_figureFunction · 0.85
_fetch_axisFunction · 0.85
_apply_propertiesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…