Update view from a selection bbox. .. note:: Intended to be overridden by new projection types, but if not, the default implementation sets the view limits to the bbox directly. Parameters ---------- bbox : 4-tuple or 3 tuple
(self, bbox, direction='in',
mode=None, twinx=False, twiny=False)
| 4451 | return new_xbound, new_ybound |
| 4452 | |
| 4453 | def _set_view_from_bbox(self, bbox, direction='in', |
| 4454 | mode=None, twinx=False, twiny=False): |
| 4455 | """ |
| 4456 | Update view from a selection bbox. |
| 4457 | |
| 4458 | .. note:: |
| 4459 | |
| 4460 | Intended to be overridden by new projection types, but if not, the |
| 4461 | default implementation sets the view limits to the bbox directly. |
| 4462 | |
| 4463 | Parameters |
| 4464 | ---------- |
| 4465 | bbox : 4-tuple or 3 tuple |
| 4466 | * If bbox is a 4 tuple, it is the selected bounding box limits, |
| 4467 | in *display* coordinates. |
| 4468 | * If bbox is a 3 tuple, it is an (xp, yp, scl) triple, where |
| 4469 | (xp, yp) is the center of zooming and scl the scale factor to |
| 4470 | zoom by. |
| 4471 | |
| 4472 | direction : str |
| 4473 | The direction to apply the bounding box. |
| 4474 | * `'in'` - The bounding box describes the view directly, i.e., |
| 4475 | it zooms in. |
| 4476 | * `'out'` - The bounding box describes the size to make the |
| 4477 | existing view, i.e., it zooms out. |
| 4478 | |
| 4479 | mode : str or None |
| 4480 | The selection mode, whether to apply the bounding box in only the |
| 4481 | `'x'` direction, `'y'` direction or both (`None`). |
| 4482 | |
| 4483 | twinx : bool |
| 4484 | Whether this axis is twinned in the *x*-direction. |
| 4485 | |
| 4486 | twiny : bool |
| 4487 | Whether this axis is twinned in the *y*-direction. |
| 4488 | """ |
| 4489 | new_xbound, new_ybound = self._prepare_view_from_bbox( |
| 4490 | bbox, direction=direction, mode=mode, twinx=twinx, twiny=twiny) |
| 4491 | if not twinx and mode != "y": |
| 4492 | self.set_xbound(new_xbound) |
| 4493 | self.set_autoscalex_on(False) |
| 4494 | if not twiny and mode != "x": |
| 4495 | self.set_ybound(new_ybound) |
| 4496 | self.set_autoscaley_on(False) |
| 4497 | |
| 4498 | def start_pan(self, x, y, button): |
| 4499 | """ |