ScatterPlot#

class skfda.exploratory.visualization.representation.ScatterPlot(fdata, chart=None, *, fig=None, axes=None, n_rows=None, n_cols=None, grid_points=None, domain_range=None, group=None, group_colors=None, group_names=None, legend=False, **kwargs)[source]#

Class used to scatter the FDataGrid object.

Parameters:
  • fdata (FData) – functional data set that we want to plot.

  • grid_points (GridPointsLike | None) – points to plot.

  • chart (Figure | Axes | None) – figure over with the graphs are plotted or axis over where the graphs are plotted. If None and ax is also None, the figure is initialized.

  • fig (Figure | None) – 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 (Axes | None) – axis over where the graphs are plotted. If None, see param fig.

  • n_rows (int | None) – 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 (int | None) – designates the number of columns of the figure to plot the different dimensions of the image. Only specified if fig and ax are None.

  • domain_range (Tuple[int, int] | DomainRangeLike | None) – Range where the function will be plotted. In objects with unidimensional domain the domain range should be a tuple with the bounds of the interval; in the case of surfaces a list with 2 tuples with the ranges for each dimension. Default uses the domain range of the functional object.

  • group (Sequence[K] | None) – contains integers from [0 to number of labels) indicating to which group each sample belongs to. Then, the samples with the same label are plotted in the same color. If None, the default value, each sample is plotted in the color assigned by matplotlib.pyplot.rcParams[‘axes.prop_cycle’].

  • group_colors (Indexable[K, ColorLike] | None) – colors in which groups are represented, there must be one for each group. If None, each group is shown with distict colors in the “Greys” colormap.

  • group_names (Indexable[K, str] | None) – name of each of the groups which appear in a legend, there must be one for each one. Defaults to None and the legend is not shown. Implies legend=True.

  • legend (bool) – if True, show a legend with the groups. If group_names is passed, it will be used for finding the names to display in the legend. Otherwise, the values passed to group will be used.

  • kwargs (Any) – if dim_domain is 1, keyword arguments to be passed to the matplotlib.pyplot.plot function; if dim_domain is 2, keyword arguments to be passed to the matplotlib.pyplot.plot_surface function.

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