datascience.tables.Table.scatter3d

Table.scatter3d(column_for_x, column_for_y, select=None, overlay=True, fit_line=False, group=None, labels=None, sizes=None, width=None, height=None, s=5, colors=None, **vargs)[source]

Convenience wrapper for Table#iscatter3d

Creates 3D scatterplots by calling Table#iscatter3d with the same arguments. Cannot be used if interactive plots are not enabled (by calling Table#interactive_plots).

Args:
column_for_x (str): The column to use for the x-axis values

and label of the scatter plots.

column_for_y (str): The column to use for the y-axis values

and label of the scatter plots.

Kwargs:
overlay (bool): If true, creates a chart with one color

per data column; if False, each plot will be displayed separately.

group: A column of categories to be used for coloring dots per

each category grouping.

labels: A column of text labels to annotate dots.

sizes: A column of values to set the relative areas of dots.

width (int): the width (in pixels) of the plot area

height (int): the height (in pixels) of the plot area

s: Size of dots. If sizes is also provided, then dots will be

in the range 0 to 2 * s.

colors: (deprecated) A synonym for group. Retained

temporarily for backwards compatibility. This argument will be removed in future releases.

show (bool): whether to show the figure; if false, the figure is returned instead

vargs (dict): additional kwargs passed to

plotly.graph_objects.Figure.update_layout

Raises:
AssertionError – Interactive plots must be enabled by calling Table#interactive_plots

first

ValueError – Every column, column_for_x, column_for_x, or select, must be

numerical

Returns:
Scatter plot of values of column_for_x and column_for_y plotted against

values for all other columns in self.

>>> table = Table().with_columns(
...     'x', make_array(9, 3, 3, 1),
...     'y', make_array(1, 2, 2, 10),
...     'z1', make_array(3, 4, 5, 6),
...     'z2', make_array(0, 2, 1, 0))
>>> table
x    | y    | z1   | z2
9    | 1    | 3    | 0
3    | 2    | 4    | 2
3    | 2    | 5    | 1
1    | 10   | 6    | 0
>>> table.iscatter3d('x', 'y') 
<plotly 3D scatterplot of values in z1 and z2 on x and y>
>>> table.iscatter3d('x', 'y', overlay=False) 
<plotly 3D scatterplot of values in z1 on x and y>
<plotly 3D scatterplot of values in z2 on x and y