Skip to content
Snippets Groups Projects
Commit ea395db2 authored by Andi Gerken's avatar Andi Gerken
Browse files

Changed robot color from gray to to white

parent a90539e0
No related branches found
No related tags found
1 merge request!38Changed robot color from gray to to white
Pipeline #51733 passed
...@@ -842,19 +842,19 @@ class File(h5py.File): ...@@ -842,19 +842,19 @@ class File(h5py.File):
def plot( def plot(
self, self,
ax=None, ax: mpl.axes = None,
lw_distances=False, lw_distances: bool = False,
lw=2, lw: int = 2,
ms=32, ms: int = 32,
figsize=None, figsize: Tuple[int] = None,
step_size=4, step_size: int = 4,
c=None, c: List = None,
cmap="Set1", cmap: mpl.colors.Colormap = "Set1",
skip_timesteps=0, skip_timesteps=0,
max_timesteps=None, max_timesteps=None,
show=False, show=False,
legend=True, legend=True,
): ) -> mpl.axes:
"""Plot the file using matplotlib.pyplot """Plot the file using matplotlib.pyplot
The tracks in the file are plotted using matplotlib.plot(). The tracks in the file are plotted using matplotlib.plot().
...@@ -862,9 +862,11 @@ class File(h5py.File): ...@@ -862,9 +862,11 @@ class File(h5py.File):
Args: Args:
ax (matplotlib.axes, optional): An axes object to plot in. If None is given, a new figure is created. ax (matplotlib.axes, optional): An axes object to plot in. If None is given, a new figure is created.
lw_distances (bool, optional): Flag to show the distances between individuals through line width. lw_distances (bool, optional): Flag to show the distances between individuals through line width.
lw(int, optional): Line width of the tracks. Defaults to 2.
ms(int, optional): Marker size of the tracks. Defaults to 32.
figsize (Tuple[int], optional): Size of a newly created figure. figsize (Tuple[int], optional): Size of a newly created figure.
step_size (int, optional): when using lw_distances, the track is split into sections which have a common line width. This parameter defines the length of the sections. step_size (int, optional): when using lw_distances, the track is split into sections which have a common line width. This parameter defines the length of the sections.
c (Array[color_representation], optional): An array of colors. Each item has to be matplotlib.colors.is_color_like(item). c (List, optional): An array of colors. Each item has to be matplotlib.colors.is_color_like(item).
cmap (matplotlib.colors.Colormap, optional): The colormap to use cmap (matplotlib.colors.Colormap, optional): The colormap to use
skip_timesteps (int, optional): Skip timesteps in the begining of the file skip_timesteps (int, optional): Skip timesteps in the begining of the file
max_timesteps (int, optional): Cut of timesteps in the end of the file. max_timesteps (int, optional): Cut of timesteps in the end of the file.
...@@ -1076,10 +1078,16 @@ class File(h5py.File): ...@@ -1076,10 +1078,16 @@ class File(h5py.File):
plt.plot([], [], linestyle="dotted", alpha=0.5, color="k", zorder=0)[0], plt.plot([], [], linestyle="dotted", alpha=0.5, color="k", zorder=0)[0],
] ]
categories = [entity.attrs.get("category", None) for entity in self.entities] categories = [entity.attrs.get("category", None) for entity in self.entities]
entity_polygons = [ entity_polygons = [
patches.Polygon(shape_vertices(options["entity_scale"]), facecolor=color) patches.Polygon(
for color in [ shape_vertices(options["entity_scale"]),
"gray" if category == "robot" else "k" for category in categories edgecolor=edgecolor,
facecolor=color,
)
for edgecolor, color in [
("k", "white") if category == "robot" else ("k", "k")
for category in categories
] ]
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment