drawLine

emlib.matplotting.drawLine(ax, x0, y0, x1, y1, color=None, linestyle='solid', alpha=None, linewidth=None, label=None, profile=None)[source]

Draw a line from (x0, y0) to (x1, y1)

Parameters:
  • ax (Axes) – a plt.Axes to draw on

  • x0 (float) – x coord of the start point

  • y0 (float) – y coord of the start point

  • x1 (float) – x coord of the end point

  • y1 (float) – y coord of the end point

  • color (Optional[float]) – the color of the line as a value 0-1 within the colormap space

  • linestyle (str) – ‘solid’, ‘dashed’

  • alpha (Optional[float]) – a float 0-1

  • label (Optional[str]) – if given, a label is plotted next to the line

  • profile – the profile (created via makeProfile) to use. Leave None to use the default profile

Return type:

None

Examples

>>> import matplotlib.pyplot as plt
>>> from emlib import matplotting
>>> fig, ax = plt.subplots()
>>> matplotting.drawLine(ax, 0, 0, 1, 1)
>>> plt.show()