Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1054a5d

Browse filesBrowse files
committed
selector auto tweaks, WIP
1 parent d3d6e1b commit 1054a5d
Copy full SHA for 1054a5d

File tree

2 files changed

+4
-4
lines changed
Filter options

2 files changed

+4
-4
lines changed

‎fastplotlib/graphics/image.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/image.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ def add_linear_selector(
280280
if axis == "x":
281281
size = self._data.value.shape[0]
282282
center = size / 2
283-
limits = (0, self._data.value.shape[1])
283+
limits = (0, self._data.value.shape[1] - 1)
284284
elif axis == "y":
285285
size = self._data.value.shape[1]
286286
center = size / 2
287-
limits = (0, self._data.value.shape[0])
287+
limits = (0, self._data.value.shape[0] - 1)
288288
else:
289289
raise ValueError("`axis` must be one of 'x' | 'y'")
290290

‎fastplotlib/graphics/line.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/line.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ def _get_linear_selector_init_args(
295295
limits = axis_vals[0], axis_vals[-1]
296296

297297
# width or height of selector
298-
size = int(np.ptp(magn_vals) * 1.5 + padding)
298+
size = np.ptp(magn_vals) * 1.5 + padding
299299

300300
# center of selector along the other axis
301-
center = np.nanmean(magn_vals)
301+
center = np.ptp(magn_vals) / 2#np.nanmean(magn_vals)
302302

303303
return bounds_init, limits, size, center

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.