Helper function to set labels for an axis
(label, mark, dim, **kwargs)
| 366 | |
| 367 | |
| 368 | def _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 | |
| 388 | def xlabel(label=None, mark=None, **kwargs): |
no test coverage detected
searching dependent graphs…