Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioroboticslab
robofish
io
Commits
6a6034fb
Commit
6a6034fb
authored
7 months ago
by
brandhoj95
Browse files
Options
Downloads
Patches
Plain Diff
added colored tracks
parent
06bfd9fa
No related branches found
No related tags found
1 merge request
!49
added colored tracks
Pipeline
#65108
passed
7 months ago
Stage: package
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/robofish/io/file.py
+6
-2
6 additions, 2 deletions
src/robofish/io/file.py
with
6 additions
and
2 deletions
src/robofish/io/file.py
+
6
−
2
View file @
6a6034fb
...
@@ -928,7 +928,7 @@ class File(h5py.File):
...
@@ -928,7 +928,7 @@ class File(h5py.File):
else
:
else
:
step_size
=
poses
.
shape
[
1
]
step_size
=
poses
.
shape
[
1
]
cmap
=
matplotlib
.
cm
.
get_cmap
(
cmap
)
cmap
=
plt
.
get_cmap
(
cmap
)
x_world
,
y_world
=
self
.
world_size
x_world
,
y_world
=
self
.
world_size
if
figsize
is
None
:
if
figsize
is
None
:
...
@@ -951,6 +951,10 @@ class File(h5py.File):
...
@@ -951,6 +951,10 @@ class File(h5py.File):
this_c
=
c
this_c
=
c
timesteps
=
poses
.
shape
[
1
]
-
1
timesteps
=
poses
.
shape
[
1
]
-
1
colours
=
plt
.
get_cmap
(
cmap
)(
np
.
linspace
(
0
,
1
,
1
+
timesteps
//
step_size
))
if
not
lw_distances
:
colours
[:]
=
this_c
for
t
in
range
(
0
,
timesteps
,
step_size
):
for
t
in
range
(
0
,
timesteps
,
step_size
):
if
lw_distances
:
if
lw_distances
:
lw
=
np
.
mean
(
line_width
[
t
:
t
+
step_size
+
1
])
lw
=
np
.
mean
(
line_width
[
t
:
t
+
step_size
+
1
])
...
@@ -958,7 +962,7 @@ class File(h5py.File):
...
@@ -958,7 +962,7 @@ class File(h5py.File):
ax
.
plot
(
ax
.
plot
(
poses
[
fish_id
,
t
:
t
+
step_size
+
1
,
0
],
poses
[
fish_id
,
t
:
t
+
step_size
+
1
,
0
],
poses
[
fish_id
,
t
:
t
+
step_size
+
1
,
1
],
poses
[
fish_id
,
t
:
t
+
step_size
+
1
,
1
],
c
=
this_c
,
c
=
colours
[
t
//
step_size
]
,
lw
=
lw
,
lw
=
lw
,
)
)
# Plotting outside of the figure to have the label
# Plotting outside of the figure to have the label
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment