Skip to content

Commit cd96ccf

Browse files
Fix incorrect colormap alignment with 3D surface peaks (#23)
Co-authored-by: fredericjs <63259596+fredericjs@users.noreply.github.com>
1 parent 0302f55 commit cd96ccf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

surfalize/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def plot_3d(surface, vertical_angle=50, horizontal_angle=0, zoom=1, cmap='jet',
128128
distance = surface.width_um * 2 / zoom
129129

130130
h_dist = np.cos(np.deg2rad(vertical_angle)) * distance
131-
x = target_position[0] + np.sin(np.deg2rad(horizontal_angle)) * h_dist
132-
y = target_position[1] + np.cos(np.deg2rad(horizontal_angle)) * h_dist
131+
x = target_position[0] - np.sin(np.deg2rad(horizontal_angle)) * h_dist
132+
y = target_position[1] - np.cos(np.deg2rad(horizontal_angle)) * h_dist
133133
z = target_position[2] + np.sin(np.deg2rad(vertical_angle)) * distance
134134

135135
camera_position = (x, y, z)

0 commit comments

Comments
 (0)