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

Method update_view

lib/matplotlib/backend_tools.py:492–521  ·  view source on GitHub ↗

Update the view limits and position for each Axes from the current stack position. If any Axes are present in the figure that aren't in the current stack position, use the home view limits for those Axes and don't update *any* positions.

(self)

Source from the content-addressed store, hash-verified

490 self.update_home_views()
491
492 def update_view(self):
493 """
494 Update the view limits and position for each Axes from the current
495 stack position. If any Axes are present in the figure that aren't in
496 the current stack position, use the home view limits for those Axes and
497 don't update *any* positions.
498 """
499
500 views = self.views[self.figure]()
501 if views is None:
502 return
503 pos = self.positions[self.figure]()
504 if pos is None:
505 return
506 home_views = self.home_views[self.figure]
507 all_axes = self.figure.get_axes()
508 for a in all_axes:
509 if a in views:
510 cur_view = views[a]
511 else:
512 cur_view = home_views[a]
513 a._set_view(cur_view)
514
515 if set(all_axes).issubset(pos):
516 for a in all_axes:
517 # Restore both the original and modified positions
518 a._set_position(pos[a][0], 'original')
519 a._set_position(pos[a][1], 'active')
520
521 self.figure.canvas.draw_idle()
522
523 def push_current(self, figure=None):
524 """

Callers 1

triggerMethod · 0.80

Calls 3

_set_positionMethod · 0.80
_set_viewMethod · 0.45
draw_idleMethod · 0.45

Tested by

no test coverage detected