Set the Axes position. Axes have two position attributes. The 'original' position is the position allocated for the Axes. The 'active' position is the position the Axes is actually drawn at. These positions are usually the same unless a fixed aspect is set t
(self, pos, which='both')
| 1162 | return self._position.frozen() |
| 1163 | |
| 1164 | def set_position(self, pos, which='both'): |
| 1165 | """ |
| 1166 | Set the Axes position. |
| 1167 | |
| 1168 | Axes have two position attributes. The 'original' position is the |
| 1169 | position allocated for the Axes. The 'active' position is the |
| 1170 | position the Axes is actually drawn at. These positions are usually |
| 1171 | the same unless a fixed aspect is set to the Axes. See |
| 1172 | `.Axes.set_aspect` for details. |
| 1173 | |
| 1174 | Parameters |
| 1175 | ---------- |
| 1176 | pos : [left, bottom, width, height] or `~matplotlib.transforms.Bbox` |
| 1177 | The new position of the Axes in `.Figure` coordinates. |
| 1178 | |
| 1179 | which : {'both', 'active', 'original'}, default: 'both' |
| 1180 | Determines which position variables to change. |
| 1181 | |
| 1182 | .. note:: |
| 1183 | This parameter is considered internal. End users should not use it. |
| 1184 | |
| 1185 | For native Matplotlib `.Axes`, the active position is |
| 1186 | determined by a combination of the original position and the |
| 1187 | aspect ratio. Any active position set by the user will therefore be |
| 1188 | overwritten by internal handling. This option is retained as it may be |
| 1189 | relevant for some third party `.Axes` subclasses. |
| 1190 | |
| 1191 | See Also |
| 1192 | -------- |
| 1193 | matplotlib.transforms.Bbox.from_bounds |
| 1194 | matplotlib.transforms.Bbox.from_extents |
| 1195 | """ |
| 1196 | self._set_position(pos, which=which) |
| 1197 | # because this is being called externally to the library we |
| 1198 | # don't let it be in the layout. |
| 1199 | self.set_in_layout(False) |
| 1200 | |
| 1201 | def _set_position(self, pos, which='both'): |
| 1202 | """ |