Skip to content

Scatterplot

A scatterplot is a graphical representation that displays the relationship between two quantitative variables. It uses dots to represent individual data points, where each dot's position is determined by the values of the two variables, one on the horizontal (x) axis and the other on the vertical (y) axis. (Fiveable)

Parameters

The scatterplot takes the standard parameters in addition to the following:

datadict, data frame

A scatterplot takes the same data as a line graph, like this:

html
<scatterplot
  data='[
    { "x": 1, "y": 10 }, 
    { "x": 2, "y": 20 },
    { "x": 3, "y": 15 },
    { "x": 4, "y": 25 },
    { "x": 5, "y": 30 },
    { "x": 6, "y": 35 }
  ]'
  width=250
  height=250
  colors='["darkblue"]'
>
</scatterplot>

which produce this:

dotsizeNumber

The optional dotsize parameter, which defaults to 5, determines the size of the dots, as this example with a dotsize of 3 shows.

Released under the MIT License. | Privacy Policy