SurfaceBoxplot#

class skfda.exploratory.visualization.SurfaceBoxplot(fdatagrid, chart=None, *, depth_method=None, factor=1.5, fig=None, axes=None, n_rows=None, n_cols=None)[source]#

Representation of the surface boxplot.

Class implementing the surface boxplot. Analogously to the functional boxplot, it is an informative exploratory tool for visualizing functional data with domain dimension 2. Nevertheless, it does not implement the enhanced surface boxplot.

Based on the center outward ordering induced by a depth measure for functional data, it represents the envelope of the 50% central region, the median curve, and the maximum non-outlying envelope [1].

Parameters:
  • fdatagrid (FDataGrid) – Object containing the data.

  • method – Method used to order the data. Defaults to modified band depth.

  • prob – List with float numbers (in the range from 1 to 0) that indicate which central regions to represent. Defaults to [0.5] which represents the 50% central region.

  • factor (float) – Number used to calculate the outlying envelope.

  • chart (Figure | Axes | None) –

  • depth_method (Depth[FDataGrid] | None) –

  • fig (Figure | None) –

  • axes (Axes | None) –

  • n_rows (int | None) –

  • n_cols (int | None) –

Attributes:
  • fdatagrid – Object containing the data.

  • median – contains the median/s.

  • central_envelope – contains the central envelope/s.

  • non_outlying_envelope – contains the non-outlying envelope/s.

  • colormap – Colormap from which the colors to represent the central regions are selected.

  • boxcol – Color of the box, which includes median and central envelope.

  • outcol – Color of the outlying envelope.

  • fig – Figure over with the graphs are plotted in case ax is not specified. If None and ax is also None, the figure is initialized.

  • axes – Axis over where the graphs are plotted. If None, see param fig.

  • n_rows – Designates the number of rows of the figure to plot the different dimensions of the image. Only specified if fig and ax are None.

  • n_cols – Designates the number of columns of the figure to plot the different dimensions of the image. Only specified if fig and ax are None.

Examples

Function \(f : \mathbb{R^2}\longmapsto\mathbb{R}\).

>>> from skfda import FDataGrid
>>> data_matrix = [[[[1], [0.7], [1]],
...                 [[4], [0.4], [5]]],
...                [[[2], [0.5], [2]],
...                 [[3], [0.6], [3]]]]
>>> grid_points = [[2, 4], [3, 6, 8]]
>>> fd = FDataGrid(data_matrix, grid_points, dataset_name="dataset",
...                argument_names=["x1_label", "x2_label"],
...                coordinate_names=["y_label"])
>>> SurfaceBoxplot(fd)
SurfaceBoxplot(
    FDataGrid=FDataGrid(
        array([[[[ 1. ],
                 [ 0.7],
                 [ 1. ]],
                [[ 4. ],
                 [ 0.4],
                 [ 5. ]]],
               [[[ 2. ],
                 [ 0.5],
                 [ 2. ]],
                [[ 3. ],
                 [ 0.6],
                 [ 3. ]]]]),
        grid_points=(array([ 2., 4.]), array([ 3., 6., 8.])),
        domain_range=((2.0, 4.0), (3.0, 8.0)),
        dataset_name='dataset',
        argument_names=('x1_label', 'x2_label'),
        coordinate_names=('y_label',),
        extrapolation=None,
        ...),
    median=array([[[ 1. ],
                   [ 0.7],
                   [ 1. ]],
                  [[ 4. ],
                   [ 0.4],
                   [ 5. ]]]),
    central envelope=(array([[[ 1. ],
                              [ 0.7],
                              [ 1. ]],
                             [[ 4. ],
                              [ 0.4],
                              [ 5. ]]]),
                      array([[[ 1. ],
                              [ 0.7],
                              [ 1. ]],
                             [[ 4. ],
                              [ 0.4],
                              [ 5. ]]])),
    outlying envelope=(array([[[ 1. ],
                               [ 0.7],
                               [ 1. ]],
                              [[ 4. ],
                               [ 0.4],
                               [ 5. ]]]),
                       array([[[ 1. ],
                               [ 0.7],
                               [ 1. ]],
                              [[ 4. ],
                               [ 0.4],
                               [ 5. ]]])))

References

Methods

hover(event)

Activate the annotation when hovering a point.

plot()

Plot the object and its data.

hover(event)[source]#

Activate the annotation when hovering a point.

Callback method that activates the annotation when hovering a specific point in a graph. The annotation is a description of the point containing its coordinates.

Parameters:

event (MouseEvent) – event object containing the artist of the point hovered.

Return type:

None

plot()[source]#

Plot the object and its data.

Returns:

figure object in which the displays and

widgets will be plotted.

Return type:

Figure

Examples using skfda.exploratory.visualization.SurfaceBoxplot#

Surface Boxplot

Surface Boxplot