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

Method position_centers

lib/matplotlib/container.py:105–116  ·  view source on GitHub ↗

Return the centers of bar positions. .. versionadded:: 3.11

(self)

Source from the content-addressed store, hash-verified

103
104 @property
105 def position_centers(self):
106 """
107 Return the centers of bar positions.
108
109 .. versionadded:: 3.11
110 """
111 if self.orientation == 'vertical':
112 return [p.get_x() + p.get_width() / 2 for p in self.patches]
113 elif self.orientation == 'horizontal':
114 return [p.get_y() + p.get_height() / 2 for p in self.patches]
115 else:
116 raise ValueError("orientation must be 'vertical' or 'horizontal'.")
117
118
119class ErrorbarContainer(Container):

Callers

nothing calls this directly

Calls 4

get_xMethod · 0.45
get_widthMethod · 0.45
get_yMethod · 0.45
get_heightMethod · 0.45

Tested by

no test coverage detected