Skip to content

Commit

Permalink
fix single pixel map
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Feb 6, 2025
1 parent 9b0ae29 commit 0ff62e5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pyFAI/gui/pilx/widgets/MapPlotWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
__contact__ = "[email protected]"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "27/01/2025"
__date__ = "31/01/2025"
__status__ = "development"

from typing import Optional
Expand Down Expand Up @@ -184,9 +184,10 @@ def setScatterData(self,
y2 = numpy.outer(y, numpy.ones(cols)).ravel()

self._scatter_item.setData(x2, y2, z)
dx = 0.5 * ((x[1:] - x[:-1]).mean()) / cols
dy = 0.5 * ((y[1:] - y[:-1]).mean()) / rows
self.setDataMargins(dx, dx, dy, dy)
if cols>1 and rows>1:
dx = 0.5 * ((x[1:] - x[:-1]).mean()) / cols
dy = 0.5 * ((y[1:] - y[:-1]).mean()) / rows
self.setDataMargins(dx, dx, dy, dy)
self.resetZoom()
self._first_plot = False
else:
Expand Down

0 comments on commit 0ff62e5

Please sign in to comment.