MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _normalize_location_orientation

Function _normalize_location_orientation

lib/matplotlib/colorbar.py:1360–1377  ·  view source on GitHub ↗
(location, orientation)

Source from the content-addressed store, hash-verified

1358
1359
1360def _normalize_location_orientation(location, orientation):
1361 if location is None:
1362 location = _get_ticklocation_from_orientation(orientation)
1363 loc_settings = _api.getitem_checked({
1364 "left": {"location": "left", "anchor": (1.0, 0.5),
1365 "panchor": (0.0, 0.5), "pad": 0.10},
1366 "right": {"location": "right", "anchor": (0.0, 0.5),
1367 "panchor": (1.0, 0.5), "pad": 0.05},
1368 "top": {"location": "top", "anchor": (0.5, 0.0),
1369 "panchor": (0.5, 1.0), "pad": 0.05},
1370 "bottom": {"location": "bottom", "anchor": (0.5, 1.0),
1371 "panchor": (0.5, 0.0), "pad": 0.15},
1372 }, location=location)
1373 loc_settings["orientation"] = _get_orientation_from_location(location)
1374 if orientation is not None and orientation != loc_settings["orientation"]:
1375 # Allow the user to pass both if they are consistent.
1376 raise TypeError("location and orientation are mutually exclusive")
1377 return loc_settings
1378
1379
1380def _get_orientation_from_location(location):

Callers 2

make_axesFunction · 0.85
make_axes_gridspecFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…