portfolio_optimization.components.visualization module
This module contains visualization tools.
- portfolio_optimization.components.visualization.plot_front(diversification_values, roc_values, color=None, label=None, c=None, vmin=None, vmax=None, alpha=None, cmap=None, ax=None)[source]
Plots a pareto front of the given data-points in a Diversification-ROC plot.
- Parameters:
diversification_values (
ArrayLike
) – 1-DArrayLike
containing the x values of the plot.roc_values (
ArrayLike
) – 1-DArrayLike
containing the y values of the plot.color (
Optional
[str
]) – Optional color to use for the points. For an overview of allowed colors see the Matplotlib Documentation. IfNone
is given, a default color will be assigned bymatplotlib
. Default isNone
.label (
Optional
[str
]) – Label to use in the legend. IfNone
is given, no label will be used. Default isNone
.c (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]],Sequence
[Union
[tuple
[float
,float
,float
],str
,tuple
[float
,float
,float
,float
],tuple
[Union
[tuple
[float
,float
,float
],str
],float
],tuple
[tuple
[float
,float
,float
,float
],float
]]],tuple
[float
,float
,float
],tuple
[float
,float
,float
,float
],tuple
[Union
[tuple
[float
,float
,float
],str
],float
],tuple
[tuple
[float
,float
,float
,float
],float
],None
]) – The marker colors as used bymatplotlib
.vmin (
Optional
[float
]) – min value of data range that colormap covers as used bymatplotlib
.vmax (
Optional
[float
]) – max value of data range that colormap covers as used bymatplotlib
.alpha (
Optional
[float
]) – The alpha blending value as used bymatplotlib
.cmap (
UnionType
[str
,Colormap
,None
]) – The Colormap instance or registered colormap name as used bymatplotlib
.ax (
Optional
[Axes
]) –Axes
to plot on. IfNone
, a new figure with oneAxes
will be created.
- Return type:
PatchCollection
- Returns:
The
matplotlib
PathCollection object created by scatter.
- portfolio_optimization.components.visualization.plot_points(diversification_values, roc_values, color=None, label=None, c=None, vmin=None, vmax=None, alpha=None, cmap=None, ax=None)[source]
Plots the given data-points in a Diversification-ROC plot.
- Parameters:
diversification_values (
ArrayLike
) – 1-DArrayLike
containing the x values of the plot.roc_values (
ArrayLike
) – 1-DArrayLike
containing the y values of the plot.color (
Optional
[str
]) – Optional color to use for the points. For an overview of allowed colors see the Matplotlib Documentation. IfNone
is given, a default color will be assigned bymatplotlib
. Default isNone
.label (
Optional
[str
]) – Label to use in the legend. IfNone
is given, no label will be used. Default isNone
.c (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]],Sequence
[Union
[tuple
[float
,float
,float
],str
,tuple
[float
,float
,float
,float
],tuple
[Union
[tuple
[float
,float
,float
],str
],float
],tuple
[tuple
[float
,float
,float
,float
],float
]]],tuple
[float
,float
,float
],tuple
[float
,float
,float
,float
],tuple
[Union
[tuple
[float
,float
,float
],str
],float
],tuple
[tuple
[float
,float
,float
,float
],float
],None
]) – The marker colors as used bymatplotlib
.vmin (
Optional
[float
]) – min value of data range that colormap covers as used bymatplotlib
.vmax (
Optional
[float
]) – max value of data range that colormap covers as used bymatplotlib
.alpha (
Optional
[float
]) – The alpha blending value as used bymatplotlib
.cmap (
UnionType
[str
,Colormap
,None
]) – The Colormap instance or registered colormap name as used bymatplotlib
.ax (
Optional
[Axes
]) –Axes
to plot on. IfNone
, a new figure with oneAxes
will be created.
- Return type:
PatchCollection
|Any
- Returns:
The
matplotlib
PathCollection object created by scatter.