tracktable.render.clock module

Draw a digital clock on a Matplotlib figure

tracktable.render.clock.digital_clock(time, formatter, position, **kwargs)[source]

Add a digital clock (a string representation of time) to the image at a user-specified location

XXX: This function may go away since it doesn’t provide any useful enhancement over just adding a text actor ourselves.

tracktable.render.clock.draw_analog_clock_on_map(time, offset=None, center=(0.5, 0.5), radius=0.05, axes=None, use_short_side_for_radius=True, long_hand_radius=0.9, short_hand_radius=0.5, tickmarks=True, tickmark_length=0.25, color='white', linewidth=1, zorder=4, label=None, label_placement='top', label_kwargs={})[source]

Draw an analog clock on a Matplotlib figure.

NOTE: THIS INTERFACE IS SUBJECT TO CHANGE. LOTS OF CHANGE.

Parameters
  • time (datetime.datetime) – Time to display

  • offset (datetime.timedelta) – Offset for local time zone. This will be added to the ‘time’ argument to determine the time that will actually be displayed.

  • center (2-tuple in [0,1] * [0, 1]) – image-space center of clock

  • radius (float in [0, 1]) – Radius of clock face

  • axes (matplotlib.axes.Axes) – axes to render into

  • use_short_side_for_radius (boolean) – Clock radius will be calculated relative to short side of figure

  • long_hand_radius (float in [0, 1]) – Radius of minute hand relative to radius of clock face

  • short_hand_radius (float in [0,1]) – Radius of hour hand relative to radius of clock face

  • tickmarks (boolean) – Whether or not to place tickmarks at every hour around the clock face

  • tickmark_length (float in [0,1]) – Length of tickmarks relative to clock face radius

  • color (colorspec) – Color for clock face and hands

  • linewidth (float) – Thickness (in points) of lines drawn

  • zorder (integer) – Ordering of clock in image element stack (higher values are on top)

  • label (string) – Label text to display near clock

  • label_placement (string) – One of ‘top’, ‘bottom’. Determines where label will be rendered relative to clock face

  • label_kwargs (dict) – Arguments to be passed to Matplotlib text renderer for label

Side Effects:
The clock actors will be added to the ‘axes’ argument or (if no

axes are supplied) to the current Matplotlib axes.

Returns

A list of Matplotlib artists added to the figure.