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

Function _init_subplot

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

Source from the content-addressed store, hash-verified

1130
1131
1132def _init_subplot(
1133 layout, subplot_type, secondary_y, x_domain, y_domain, max_subplot_ids=None
1134):
1135 # Normalize subplot type
1136 subplot_type = _validate_coerce_subplot_type(subplot_type)
1137
1138 if max_subplot_ids is None:
1139 max_subplot_ids = _get_initial_max_subplot_ids()
1140
1141 # Clamp domain elements between [0, 1].
1142 # This is only needed to combat numerical precision errors
1143 # See GH1031
1144 x_domain = [max(0.0, x_domain[0]), min(1.0, x_domain[1])]
1145 y_domain = [max(0.0, y_domain[0]), min(1.0, y_domain[1])]
1146
1147 if subplot_type == "xy":
1148 subplot_refs = _init_subplot_xy(
1149 layout, secondary_y, x_domain, y_domain, max_subplot_ids
1150 )
1151 elif subplot_type in _single_subplot_types:
1152 subplot_refs = _init_subplot_single(
1153 layout, subplot_type, x_domain, y_domain, max_subplot_ids
1154 )
1155 elif subplot_type == "domain":
1156 subplot_refs = _init_subplot_domain(x_domain, y_domain)
1157 else:
1158 raise ValueError("Unsupported subplot type: {}".format(repr(subplot_type)))
1159
1160 return subplot_refs
1161
1162
1163def _get_cartesian_label(x_or_y, r, c, cnt):

Callers 1

make_subplotsFunction · 0.85

Calls 6

_init_subplot_xyFunction · 0.85
_init_subplot_singleFunction · 0.85
_init_subplot_domainFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected