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 callingTable#interactive_plots
).- Args:
column_for_x
(str
): The column to use for the x-axis valuesand label of the scatter plots.
column_for_y
(str
): The column to use for the y-axis valuesand label of the scatter plots.
- Kwargs:
overlay
(bool
): If true, creates a chart with one colorper data column; if False, each plot will be displayed separately.
group
: A column of categories to be used for coloring dots pereach 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 areaheight
(int
): the height (in pixels) of the plot areas
: Size of dots. If sizes is also provided, then dots will bein the range 0 to 2 * s.
colors
: (deprecated) A synonym forgroup
. Retainedtemporarily for backwards compatibility. This argument will be removed in future releases.
show
(bool
): whether to show the figure; if false, the figure is returned insteadvargs
(dict
): additional kwargs passed toplotly.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
, orselect
, must be numerical
- AssertionError – Interactive plots must be enabled by calling
- Returns:
- Scatter plot of values of
column_for_x
andcolumn_for_y
plotted against values for all other columns in self.
- Scatter plot of values of
>>> 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