drawLine¶
- emlib.matplotting.drawLine(ax, x0, y0, x1, y1, color=None, linestyle='solid', alpha=None, linewidth=None, label='', profile={'alpha': 0.75, 'annotation_alpha': 0.3, 'annotation_color': (0, 0, 0), 'autoscale': True, 'background': (0, 0, 0), 'colormap': 'jet', 'edgecolor': 1, 'facecolor': 0.8, 'label_alpha': 0.75, 'label_font': 'sans-serif', 'label_size': 10, 'line_alpha': 0.8, 'line_style': 'solid', 'linewidth': 1}, cmap='', autoscale=None)[source]¶
Draw a line from
(x0, y0)to(x1, y1)- Parameters:
ax (Axes) – a 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 (float) – the color of the line as a value 0-1 within the colormap space
linestyle – ‘solid’, ‘dashed’
alpha (float) – a float 0-1
label – if given, a label is plotted next to the line
autoscale (bool | None) – autoscale axis if True
profile – the profile (created via makeProfile) to use.
- 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()