Skip to content

Commit f045874

Browse files
committed
Fix heatmap orientation by transposing data for PyQtGraph
Updated heatmap rendering in Heatmap class to transpose data before displaying with PyQtGraph, ensuring correct axis orientation. Also bumped version to 1.2.5 in pyproject.toml and __init__.py.
1 parent 6d23365 commit f045874

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ where = ["src"]
1010

1111
[project]
1212
name = "qmeasure"
13-
version = "1.2.4"
13+
version = "1.2.5"
1414
description = "Measurement code for condensed matter groups at UW based on QCoDeS."
1515
readme = {file = "README.md", content-type = "text/markdown"}
1616
license = "GPL-3.0-or-later"

src/measureit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
try:
4949
__version__ = metadata.version("qmeasure")
5050
except metadata.PackageNotFoundError: # pragma: no cover - dev installs
51-
__version__ = "1.2.4"
51+
__version__ = "1.2.5"
5252

5353

5454
# Display data directory info on first import (only in interactive sessions)

src/measureit/visualization/heatmap_thread.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ def create_figs(self):
359359
self._ensure_surface(self.sweep.heatmap_ind)
360360
self.heatmap_data = self.param_surfaces[self.sweep.heatmap_ind]["data"]
361361
# Set up the initial image with proper scaling
362-
self.image_item.setImage(self.heatmap_data)
362+
# Transpose: our data is [outer, inner] but PyQtGraph uses [x, y] order
363+
self.image_item.setImage(self.heatmap_data.T)
363364

364365
# Set the coordinate transformation for proper axis scaling
365366
# Use setRect as the primary method (more reliable than transform)
@@ -546,7 +547,8 @@ def update_heatmap(self):
546547
current_idx = getattr(self.sweep, "heatmap_ind", 0)
547548
self._ensure_surface(current_idx)
548549
self.heatmap_data = self.param_surfaces[current_idx]["data"]
549-
self.image_item.setImage(self.heatmap_data)
550+
# Transpose: our data is [outer, inner] but PyQtGraph uses [x, y] order
551+
self.image_item.setImage(self.heatmap_data.T)
550552

551553
# Set color levels: auto or leave to user via histogram LUT
552554
if self._auto_levels_enabled:
@@ -667,7 +669,8 @@ def _on_param_selected(self, combo_index: int):
667669
# Refresh the image to show the newly selected surface
668670
view_box = self.plot_item.getViewBox()
669671
view_range = view_box.viewRange()
670-
self.image_item.setImage(self.heatmap_data)
672+
# Transpose: our data is [outer, inner] but PyQtGraph uses [x, y] order
673+
self.image_item.setImage(self.heatmap_data.T)
671674

672675
# Re-apply coordinate transformation after setImage (critical for correct axis scaling)
673676
try:

0 commit comments

Comments
 (0)