MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / FancyBboxPatch

Class FancyBboxPatch

site-packages/matplotlib/patches.py:2413–2642  ·  view source on GitHub ↗

Draw a fancy box around a rectangle with lower left at *xy*=(*x*, *y*) with specified width and height. :class:`FancyBboxPatch` class is similar to :class:`Rectangle` class, but it draws a fancy box around the rectangle. The transformation of the rectangle box to the fancy box

Source from the content-addressed store, hash-verified

2411
2412
2413class FancyBboxPatch(Patch):
2414 """
2415 Draw a fancy box around a rectangle with lower left at *xy*=(*x*,
2416 *y*) with specified width and height.
2417
2418 :class:`FancyBboxPatch` class is similar to :class:`Rectangle`
2419 class, but it draws a fancy box around the rectangle. The
2420 transformation of the rectangle box to the fancy box is delegated
2421 to the :class:`BoxTransmuterBase` and its derived classes.
2422
2423 """
2424
2425 _edge_default = True
2426
2427 def __str__(self):
2428 s = self.__class__.__name__ + "((%g, %g), width=%g, height=%g)"
2429 return s % (self._x, self._y, self._width, self._height)
2430
2431 @docstring.dedent_interpd
2432 def __init__(self, xy, width, height,
2433 boxstyle="round",
2434 bbox_transmuter=None,
2435 mutation_scale=1.,
2436 mutation_aspect=None,
2437 **kwargs):
2438 """
2439 *xy* = lower left corner
2440
2441 *width*, *height*
2442
2443 *boxstyle* determines what kind of fancy box will be drawn. It
2444 can be a string of the style name with a comma separated
2445 attribute, or an instance of :class:`BoxStyle`. Following box
2446 styles are available.
2447
2448 %(AvailableBoxstyles)s
2449
2450 *mutation_scale* : a value with which attributes of boxstyle
2451 (e.g., pad) will be scaled. default=1.
2452
2453 *mutation_aspect* : The height of the rectangle will be
2454 squeezed by this value before the mutation and the mutated
2455 box will be stretched by the inverse of it. default=None.
2456
2457 Valid kwargs are:
2458 %(Patch)s
2459 """
2460
2461 Patch.__init__(self, **kwargs)
2462
2463 self._x = xy[0]
2464 self._y = xy[1]
2465 self._width = width
2466 self._height = height
2467
2468 if boxstyle == "custom":
2469 if bbox_transmuter is None:
2470 raise ValueError("bbox_transmuter argument is needed with "

Callers 5

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
set_bboxMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected