skcriteria.plot package

Plotting utilities

class skcriteria.plot.DataPlotMethods(data)[source]

Bases: object

Data plotting accessor and method

Examples

>>> data.plot()
>>> data.plot.hist()
>>> data.plot.scatter('x', 'y')
>>> data.plot.radar()

These plotting methods can also be accessed by calling the accessor as a method with the kind argument: data.plot(kind='violin') is equivalent to data.plot.violin()

Methods

__call__([kind]) Make plots of Data using matplotlib.
plot(func[, mnorm, wnorm, anames, cnames, …]) Preprocess the data and send to the plot function func.
preprocess(data, mnorm, wnorm, anames, …) Preprocess the data to be plotted.
radar(**kwargs) Creates a radar chart, also known as a spider or star chart (http://en.wikipedia.org/wiki/Radar_chart).
bars  
box  
hist  
scatter  
to_str  
violin  
plot(func, mnorm='none', wnorm='none', anames=None, cnames=None, cmap=None, weighted=True, show_criteria=True, min2max=False, push_negatives=False, addepsto0=False, **kwargs)[source]

Preprocess the data and send to the plot function func.

Parameters:
func : callable

The function that make the plot. The return value of func are the return value of this method.

mnorm: string, callable, optional (default=”none”)

Normalization method for the alternative matrix.

wnorm : string, callable, optional (default=”none”)

Normalization method for the weights array.

anames : list of str or None, optional (default=None)

The list of alternative names to be render in the plot. If is None then the alternative names of data are used.

cnames : list of str or None, optional (default=None)

The list of criteria names to be render in the plot. If is None then the criteria names of data are used.

cmap : string or None, optional (default=None)

Name of the color map to be used (https://matplotlib.org/users/colormaps.html)

weighted : bool, optional (default=True)

If the data must be weighted before redering.

show_criteria : bool, optional (default=True)

I the sense of optimality must be rendered in the plot.

min2max : bool, optional (default=False)

If true all the data of the minimization criteria are inverted before render.

push_negatives : bool, optional (default=False)

If True all the criterias with some value < 0 are incremented to be at least 0 in the minimun value.

addepsto0 : bool, optional (default=False)

If true add an small value to all the zeros inside the data.

kwargs :

Arguments to send to func

Returns:
The return value of func.

Notes

All the plot methods of Scikit-Criteria returns a matplotlib axis.

preprocess(data, mnorm, wnorm, anames, cnames, cmap, weighted, show_criteria, min2max, push_negatives, addepsto0)[source]

Preprocess the data to be plotted.

Parameters:
data : skcritria.core.Data

The data to be preprocessed.

mnorm: string, callable

Normalization method for the alternative matrix.

wnorm : string, callable

Normalization method for the weights array.

anames : list of str or None

The list of alternative names to be render in the plot. If is None then the alternative names of data are used.

cnames : list of str or None

The list of criteria names to be render in the plot. If is None then the criteria names of data are used.

cmap : string or None

Name of the color map to be used (https://matplotlib.org/users/colormaps.html)

weighted : bool

If the data must be weighted before redering.

show_criteria : bool

I the sense of optimality must be rendered in the plot.

min2max : bool

If true all the data of the minimization criteria are inverted before render.

push_negatives : bool

If True all the criterias with some value < 0 are incremented to be at least 0 in the minimun value.

addepsto0 : bool

If true add an small value to all the zeros inside the data.

Returns:
preprocessed_data : dict

All the data ready to be sended to a plot function

radar(**kwargs)[source]

Creates a radar chart, also known as a spider or star chart (http://en.wikipedia.org/wiki/Radar_chart).

A radar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point. The relative position and angle of the axes is typically uninformative.

Parameters:
frame : {“polygon”, “circle”}

Shape of frame surrounding axes.

ax : None or PolarAxes, optional (default=None)

Axis where the radar must be redered. Is is None a new axis are created.

legendcol : int, optional (default=5)

How many columns must has the legend.

subplots_kwargs : dict or None, optional (default=None)

Argument to send to matplotlib.pyplot.subplots if axis is None. If axis is not None, subplots_kwargs are ignored.

Returns:
ax : matplotlib.projections.polar.PolarAxes

Axis where the radar are rendered

See also

DataPlotMethods.plot
To check all the available parameters

Notes

All the parameters in plot() are supported; but by default this method override some default values:

  • show_criteria=False
  • min2max=True
  • push_negatives=True
  • addepsto0=True