MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / vlines

Method vlines

lib/matplotlib/axes/_axes.py:1208–1295  ·  view source on GitHub ↗

Plot vertical lines at each *x* from *ymin* to *ymax*. Parameters ---------- x : float or array-like x-indexes where to plot the lines. ymin, ymax : float or array-like Respective beginning and end of each line. If scalars are

(self, x, ymin, ymax, colors=None, linestyles='solid',
               label='', **kwargs)

Source from the content-addressed store, hash-verified

1206 @_preprocess_data(replace_names=["x", "ymin", "ymax", "colors"],
1207 label_namer="x")
1208 def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
1209 label='', **kwargs):
1210 """
1211 Plot vertical lines at each *x* from *ymin* to *ymax*.
1212
1213 Parameters
1214 ----------
1215 x : float or array-like
1216 x-indexes where to plot the lines.
1217
1218 ymin, ymax : float or array-like
1219 Respective beginning and end of each line. If scalars are
1220 provided, all lines will have the same length.
1221
1222 colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
1223
1224 linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
1225
1226 label : str, default: ''
1227
1228 Returns
1229 -------
1230 `~matplotlib.collections.LineCollection`
1231
1232 Other Parameters
1233 ----------------
1234 data : indexable object, optional
1235 DATA_PARAMETER_PLACEHOLDER
1236 **kwargs : `~matplotlib.collections.LineCollection` properties.
1237
1238 See Also
1239 --------
1240 hlines : horizontal lines
1241 axvline : vertical line across the Axes
1242 """
1243
1244 # We do the conversion first since not all unitized data is uniform
1245 x, ymin, ymax = self._process_unit_info(
1246 [("x", x), ("y", ymin), ("y", ymax)], kwargs)
1247
1248 if not np.iterable(x):
1249 x = [x]
1250 if not np.iterable(ymin):
1251 ymin = [ymin]
1252 if not np.iterable(ymax):
1253 ymax = [ymax]
1254
1255 # Create and combine masked_arrays from input
1256 x, ymin, ymax = cbook._combine_masks(x, ymin, ymax)
1257 x = np.ravel(x)
1258 ymin = np.ravel(ymin)
1259 ymax = np.ravel(ymax)
1260
1261 masked_verts = np.ma.empty((len(x), 2, 2))
1262 masked_verts[:, 0, 0] = x
1263 masked_verts[:, 0, 1] = ymin
1264 masked_verts[:, 1, 0] = x
1265 masked_verts[:, 1, 1] = ymax

Callers 15

xcorrMethod · 0.95
__init__Method · 0.80
vlinesFunction · 0.80
test_vlinesMethod · 0.80
test_acorrFunction · 0.80
test_acorr_integersFunction · 0.80
test_vlinesFunction · 0.80
test_vlines_defaultFunction · 0.80
test_lines_with_colorsFunction · 0.80
test_striped_linesFunction · 0.80
test_nn_pixel_alignmentFunction · 0.80

Calls 8

_process_unit_infoMethod · 0.80
add_collectionMethod · 0.80
_internal_updateMethod · 0.80
get_datalimMethod · 0.45
get_transformMethod · 0.45
update_datalimMethod · 0.45

Tested by 11

test_vlinesMethod · 0.64
test_acorrFunction · 0.64
test_acorr_integersFunction · 0.64
test_vlinesFunction · 0.64
test_vlines_defaultFunction · 0.64
test_lines_with_colorsFunction · 0.64
test_striped_linesFunction · 0.64
test_nn_pixel_alignmentFunction · 0.64