MCPcopy
hub / github.com/pandas-dev/pandas / _check_has_errorbars

Function _check_has_errorbars

pandas/tests/plotting/common.py:343–368  ·  view source on GitHub ↗

Check axes has expected number of errorbars Parameters ---------- axes : matplotlib Axes object, or its list-like xerr : number expected number of x errorbar yerr : number expected number of y errorbar

(axes, xerr=0, yerr=0)

Source from the content-addressed store, hash-verified

341
342
343def _check_has_errorbars(axes, xerr=0, yerr=0):
344 """
345 Check axes has expected number of errorbars
346
347 Parameters
348 ----------
349 axes : matplotlib Axes object, or its list-like
350 xerr : number
351 expected number of x errorbar
352 yerr : number
353 expected number of y errorbar
354 """
355 axes = _flatten_visible(axes)
356 for ax in axes:
357 containers = ax.containers
358 xerr_count = 0
359 yerr_count = 0
360 for c in containers:
361 has_xerr = getattr(c, "has_xerr", False)
362 has_yerr = getattr(c, "has_yerr", False)
363 if has_xerr:
364 xerr_count += 1
365 if has_yerr:
366 yerr_count += 1
367 assert xerr == xerr_count
368 assert yerr == yerr_count
369
370
371def _check_box_return_type(

Calls 1

_flatten_visibleFunction · 0.85