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 onx0 (
float
) – x coord of the start pointy0 (
float
) – y coord of the start pointx1 (
float
) – x coord of the end pointy1 (
float
) – y coord of the end pointcolor (
Optional
[float
]) – the color of the line as a value 0-1 within the colormap spacelinestyle (
str
) – ‘solid’, ‘dashed’alpha (
Optional
[float
]) – a float 0-1label (
Optional
[str
]) – if given, a label is plotted next to the lineprofile – 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()