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

Function _init_subplot_single

plotly/_subplots.py:1047–1072  ·  view source on GitHub ↗
(
    layout, subplot_type, x_domain, y_domain, max_subplot_ids=None
)

Source from the content-addressed store, hash-verified

1045
1046
1047def _init_subplot_single(
1048 layout, subplot_type, x_domain, y_domain, max_subplot_ids=None
1049):
1050 if max_subplot_ids is None:
1051 max_subplot_ids = _get_initial_max_subplot_ids()
1052
1053 # Add scene to layout
1054 cnt = max_subplot_ids[subplot_type] + 1
1055 label = "{subplot_type}{cnt}".format(
1056 subplot_type=subplot_type, cnt=cnt if cnt > 1 else ""
1057 )
1058 scene = dict(domain={"x": x_domain, "y": y_domain})
1059 layout[label] = scene
1060
1061 trace_key = (
1062 "subplot" if subplot_type in _subplot_prop_named_subplot else subplot_type
1063 )
1064
1065 subplot_ref = SubplotRef(
1066 subplot_type=subplot_type, layout_keys=(label,), trace_kwargs={trace_key: label}
1067 )
1068
1069 # increment max_subplot_id
1070 max_subplot_ids[subplot_type] = cnt
1071
1072 return (subplot_ref,)
1073
1074
1075def _init_subplot_domain(x_domain, y_domain):

Callers 1

_init_subplotFunction · 0.85

Calls 2

formatMethod · 0.45

Tested by

no test coverage detected