Vinecop.plot

Vinecop.plot(self, tree: object | None = None, add_edge_labels: bool = True, layout: str = 'graphviz', vars_names: object | None = None) None

Generates a plot for the Vinecop object.

This method generates a plot of the vine copula structure. It can be used to visualize the tree structure of the vine copula.

Parameters:
tree: list[int] (default=None)

The tree indice(s) to plot. If None, all trees are plotted.

add_edge_labels: bool (default=True)

Whether to add edge labels to the plot.

layout: str (default=”graphviz”)

The layout to use for plotting. Either “graphviz” or “spring_layout”.

vars_names: list[str] (default=None)

The names of the variables for the vine model. If None, the indices are used.

Returns:
Nothing, the function generates a plot and shows it using matplotlib.

Examples

>>> import pyvinecopulib as pv
>>> import numpy as np
>>> np.random.seed(1234)
>>> u = np.random.uniform(0, 1, size=(20, 10))
>>> vc = pv.Vinecop.from_data(
...     u,
...     controls=pv.FitControlsVinecop(family_set=[pv.BicopFamily.indep]),
... )
>>> vc.plot(tree=[0, 1, 2])  # Plots the first three trees
>>> vars_names = ["X" + str(i) for i in range(10)]
>>> vc.plot(vars_names=vars_names)