matplotlib.patches.BoxStyle#

class matplotlib.patches.BoxStyle(stylename, **kwargs)[source]#

Bases: _Style

BoxStyle is a container class which defines several boxstyle classes, which are used for FancyBboxPatch.

A style object can be created as:

BoxStyle.Round(pad=0.2)

or:

BoxStyle("Round", pad=0.2)

or:

BoxStyle("Round, pad=0.2")

The following boxstyle classes are defined.

Class

Name

Attrs

Square

square

pad=0.3

Circle

circle

pad=0.3

LArrow

larrow

pad=0.3

RArrow

rarrow

pad=0.3

DArrow

darrow

pad=0.3

Round

round

pad=0.3, rounding_size=None

Round4

round4

pad=0.3, rounding_size=None

Sawtooth

sawtooth

pad=0.3, tooth_size=None

Roundtooth

roundtooth

pad=0.3, tooth_size=None

An instance of a boxstyle class is a callable object, with the signature

__call__(self, x0, y0, width, height, mutation_size) -> Path

x0, y0, width and height specify the location and size of the box to be drawn; mutation_size scales the outline properties such as padding.

Return the instance of the subclass with the given style name.

class Circle(pad=0.3)[source]#

Bases: object

A circular box.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class DArrow(pad=0.3)[source]#

Bases: object

A box in the shape of a two-way arrow.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class LArrow(pad=0.3)[source]#

Bases: object

A box in the shape of a left-pointing arrow.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class RArrow(pad=0.3)[source]#

Bases: LArrow

A box in the shape of a right-pointing arrow.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class Round(pad=0.3, rounding_size=None)[source]#

Bases: object

A box with round corners.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

rounding_sizefloat, default: pad

Radius of the corners.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class Round4(pad=0.3, rounding_size=None)[source]#

Bases: object

A box with rounded edges.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

rounding_sizefloat, default: pad/2

Rounding of edges.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class Roundtooth(pad=0.3, tooth_size=None)[source]#

Bases: Sawtooth

A box with a rounded sawtooth outline.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

tooth_sizefloat, default: pad/2

Size of the sawtooth.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class Sawtooth(pad=0.3, tooth_size=None)[source]#

Bases: object

A box with a sawtooth outline.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

tooth_sizefloat, default: pad/2

Size of the sawtooth.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

class Square(pad=0.3)[source]#

Bases: object

A square box.

Parameters:
padfloat, default: 0.3

The amount of padding around the original box.

__call__(x0, y0, width, height, mutation_size)[source]#

Call self as a function.

Examples using matplotlib.patches.BoxStyle#

Reference for Matplotlib artists

Reference for Matplotlib artists

Reference for Matplotlib artists