Skip to content

Commit a4d122e

Browse files
committed
fix set_xylim after pan
1 parent cd2b009 commit a4d122e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/matplotgl/axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ def set_xlim(self, left, right=None):
492492
left = left[0]
493493
self._xmin = left
494494
self._xmax = right
495-
self.camera.left = left
496-
self.camera.right = right
495+
self.camera.left = left - self.camera.position[0]
496+
self.camera.right = right - self.camera.position[0]
497497
self._make_xticks()
498498

499499
def get_ylim(self):
@@ -508,8 +508,8 @@ def set_ylim(self, bottom, top=None):
508508
bottom = bottom[0]
509509
self._ymin = bottom
510510
self._ymax = top
511-
self.camera.bottom = bottom
512-
self.camera.top = top
511+
self.camera.bottom = bottom - self.camera.position[1]
512+
self.camera.top = top - self.camera.position[1]
513513
self._make_yticks()
514514

515515
def get_xticks(self):

0 commit comments

Comments
 (0)