# scatterboxplot

scatterboxplot creates scatter diagram with marginal boxplots

## Syntax

• h=scatterboxplot(x,y)example
• h=scatterboxplot(x,y,Name,Value)example

## Description

scatterboxplot displays a 2D scatter plot with marginal boxplots. It receives data in two vectors X and Y, and puts a univariate boxplot on the horizontal and vertical axes of the plot. x and y must have the same length.

 h =scatterboxplot(x, y) A 2D scatter plot with marginal boxplots.

 h =scatterboxplot(x, y, Name, Value) A 2D scatter plot with marginal boxplots, for grouped data.

## Examples

expand all

### A 2D scatter plot with marginal boxplots.

n=100;
scatterboxplot(randn(n,1),randn(n,1))
ans =

1×3 Axes array:

Axes    Axes    Axes



### A 2D scatter plot with marginal boxplots, for grouped data.

n=100; group=ones(n,1);
group(1:50)=2; scatterboxplot(randn(n,1),randn(n,1),'Group',group)
ans =

1×3 Axes array:

Axes    Axes    Axes



## Input Arguments

### x — Input data. Vector or 1-column matrix.

The structure contains the univariate data to display in the x axis.

Data Types: single| double

### y — Input data. Vector or 1-column matrix.

The structure contains the univariate data to display in the y axis.

Data Types: single| double

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as  Name1,Value1,...,NameN,ValueN.

Example:

### Group —A grouping variable.vector.

Vector of group identifiers.

With this option scatterboxplot creates a 2D GSCATTER plot instead of a SCATTER plot, and the marginal boxplots are replaced by grouped boxplots.

Data Types - scalar

Example:

Data Types: scalar Example - Group,[1,1,1,2,2,2,2,2,2]

## Output Arguments

### h —Vector of handles.  Vector

Contains the three axes handles for the scatterplot, the plot along the horizontal axis, and the plot along the vertical axis, respectively..

Data Types - single | double.