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

Method __init__

lib/matplotlib/quiver.py:283–359  ·  view source on GitHub ↗

Add a key to a quiver plot. The positioning of the key depends on *X*, *Y*, *coordinates*, and *labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position of the middle of the key arrow. If *labelpos* is 'E', *X*, *Y* positions the head, and if *la

(self, Q, X, Y, U, label,
                 *, angle=0, coordinates='axes', color=None, labelsep=0.1,
                 labelpos='N', labelcolor=None, fontproperties=None,
                 zorder=None, **kwargs)

Source from the content-addressed store, hash-verified

281 pivot = {'N': 'middle', 'S': 'middle', 'E': 'tip', 'W': 'tail'}
282
283 def __init__(self, Q, X, Y, U, label,
284 *, angle=0, coordinates='axes', color=None, labelsep=0.1,
285 labelpos='N', labelcolor=None, fontproperties=None,
286 zorder=None, **kwargs):
287 """
288 Add a key to a quiver plot.
289
290 The positioning of the key depends on *X*, *Y*, *coordinates*, and
291 *labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position of
292 the middle of the key arrow. If *labelpos* is 'E', *X*, *Y* positions
293 the head, and if *labelpos* is 'W', *X*, *Y* positions the tail; in
294 either of these two cases, *X*, *Y* is somewhere in the middle of the
295 arrow+label key object.
296
297 Parameters
298 ----------
299 Q : `~matplotlib.quiver.Quiver`
300 A `.Quiver` object as returned by a call to `~.Axes.quiver()`.
301 X, Y : float
302 The location of the key.
303 U : float
304 The length of the key.
305 label : str
306 The key label (e.g., length and units of the key).
307 angle : float, default: 0
308 The angle of the key arrow, in degrees anti-clockwise from the
309 horizontal axis.
310 coordinates : {'axes', 'figure', 'data', 'inches'}, default: 'axes'
311 Coordinate system and units for *X*, *Y*: 'axes' and 'figure' are
312 normalized coordinate systems with (0, 0) in the lower left and
313 (1, 1) in the upper right; 'data' are the axes data coordinates
314 (used for the locations of the vectors in the quiver plot itself);
315 'inches' is position in the figure in inches, with (0, 0) at the
316 lower left corner.
317 color : :mpltype:`color`
318 Overrides face and edge colors from *Q*.
319 labelpos : {'N', 'S', 'E', 'W'}
320 Position the label above, below, to the right, to the left of the
321 arrow, respectively.
322 labelsep : float, default: 0.1
323 Distance in inches between the arrow and the label.
324 labelcolor : :mpltype:`color`, default: :rc:`text.color`
325 Label color.
326 fontproperties : dict, optional
327 A dictionary with keyword arguments accepted by the
328 `~matplotlib.font_manager.FontProperties` initializer:
329 *family*, *style*, *variant*, *size*, *weight*.
330 zorder : float
331 The zorder of the key. The default is 0.1 above *Q*.
332 **kwargs
333 Any additional keyword arguments are used to override vector
334 properties taken from *Q*.
335 """
336 super().__init__()
337 self.Q = Q
338 self.X = X
339 self.Y = Y
340 self.U = U

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
set_colorMethod · 0.45

Tested by

no test coverage detected