MCPcopy Index your code
hub / github.com/plotly/plotly.py / _check_hv_spacing

Function _check_hv_spacing

plotly/_subplots.py:527–543  ·  view source on GitHub ↗
(dimsize, spacing, name, dimvarname, dimname)

Source from the content-addressed store, hash-verified

525 )
526
527 def _check_hv_spacing(dimsize, spacing, name, dimvarname, dimname):
528 if spacing < 0 or spacing > 1:
529 raise ValueError("%s spacing must be between 0 and 1." % (name,))
530 if dimsize <= 1:
531 return
532 max_spacing = 1.0 / float(dimsize - 1)
533 if spacing > max_spacing:
534 raise ValueError(
535 """{name} spacing cannot be greater than (1 / ({dimvarname} - 1)) = {max_spacing:f}.
536The resulting plot would have {dimsize} {dimname} ({dimvarname}={dimsize}).""".format(
537 dimvarname=dimvarname,
538 name=name,
539 dimname=dimname,
540 max_spacing=max_spacing,
541 dimsize=dimsize,
542 )
543 )
544
545 # ### horizontal_spacing ###
546 if horizontal_spacing is None:

Callers 1

make_subplotsFunction · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected