Skip to content

Commit

Permalink
Clarify coordinate system linked to the head
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed May 23, 2024
1 parent e088432 commit 25bb659
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/compute_polar_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@
# Polar plot of the head vector within a time window
# ---------------------------------------------------
# We can also use a polar plot to represent the head vector in time,
# in a coordinate system centred at the head of the mouse. Again,
# in a coordinate system always parallel to the pixel coordinate system
# but centred at the midpoint between the mouse's ears. Again,
# this will be easier to visualise if we focus on a smaller time window.

# select phi values within a time window
Expand All @@ -356,7 +357,7 @@
ax = fig.add_subplot(projection="polar")
sc = ax.scatter(
phi,
np.ones_like(phi),
np.ones_like(phi), # assign a constant value rho=1 for visualization
c=time_window,
cmap="viridis",
s=50,
Expand All @@ -381,8 +382,11 @@
fig.show()

# %%
# In the polar plot above, the midpoint between the ears is at the centre of
# the plot. The tip of the head vector (the `snout`) is represented with
# color markers at a constant `rho` value of 1. Markers are colored by frame.
# The polar plot shows how in this small time window of 20 frames,
# the head of the mouse moved from right to left.
# the head of the mouse turned clockwise.

# %%
# Convert polar coordinates to cartesian
Expand Down

0 comments on commit 25bb659

Please sign in to comment.