Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8409523

Browse files
authored
fix limits when rect selector is added from image (#641)
* fix limits when rect selector is added from image * fix docstring
1 parent 56abbd9 commit 8409523

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fastplotlib/graphics/image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ def add_rectangle_selector(
419419
selection = (0, int(diagonal / 4), 0, int(diagonal / 4))
420420

421421
# min/max limits are image shape
422-
limits = (0, self._data.value.shape[0], 0, self._data.value.shape[1])
422+
# rows are ys, columns are xs
423+
limits = (0, self._data.value.shape[1], 0, self._data.value.shape[0])
423424

424425
selector = RectangleSelector(
425426
selection=selection,

fastplotlib/graphics/selectors/_rectangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def get_selected_indices(
430430
-------
431431
Union[np.ndarray, List[np.ndarray]]
432432
data indicies of the selection
433-
| tuple of [row_indices, y_indices_array] if the graphic is an image
433+
| tuple of [row_indices, col_indices] if the graphic is an image
434434
| list of indices along the x-dimension for each line if graphic is a line collection
435435
| array of indices along the x-dimension if graphic is a line
436436
"""

0 commit comments

Comments
 (0)