Loading...

verticapy.vDataFrame.scatter_matrix#

vDataFrame.scatter_matrix(columns: str | list[str] | None = None, max_nb_points: int = 1000, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure#

Draws the scatter matrix of the vDataFrame.

Parameters#

columns: SQLColumns, optional

List of the vDataColumns names. If empty, all numerical vDataColumns are used.

max_nb_points: int, optional

Maximum number of points to display for each scatter plot.

**style_kwargs

Any optional parameter to pass to the plotting functions.

Returns#

obj

Plotting Object.

Examples#

Note

The below example is a very basic one. For other more detailed examples and customization options, please see Chart Gallery

Let’s begin by importing VerticaPy.

import verticapy as vp

Let’s also import numpy to create a dataset.

import numpy as np

We can create a variable N to fix the size:

N = 30

Let’s generate a dataset using the following data.

data = vp.vDataFrame(
    {
        "x": np.random.normal(5, 1, N),
        "y": np.random.normal(8, 1.5, N),
    }
)

Below is an examples of one type of scatter_matrix plots:

  • Scatter Matrix

data.scatter_matrix(columns = ["x", "y"])
Out[5]: 
array([[<Axes: ylabel='x'>, <Axes: >],
       [<Axes: xlabel='x', ylabel='y'>, <Axes: xlabel='y'>]], dtype=object)
../_images/core_vdataframe_plotting_vdf_scatter_matrix.png

See also

vDataFrame.contour() : Contour Plot.
vDataFrame.heatmap() : Heatmap.