Skip to content

Dot plot

Investopedia says

A dot plot is a simple form of data visualization that consists of data points plotted as dots on a graph with an x- and y-axis. These types of charts are used to graphically depict certain data trends or groupings.

Parameters

Dot plots accept the standard parameter with data defined as follows:

dataList of dicts

The data required for a dot plot consists of a (JSON) list of dictionaries, each one of which includes a category and a value, as follows:

python
[
    { "category": "A", "value": 10 },
    { "category": "A", "value": 12 },
    { "category": "A", "value": 16 },
    { "category": "B", "value": 20 },
    { "category": "B", "value": 24 },
    { "category": "B", "value": 28 },
    { "category": "C", "value": 12 },
    { "category": "C", "value": 15 },
    { "category": "C", "value": 21 }
]

Example

Here is an example of a dot plot in HTML/Markdown using the above data.

html
<dotplot
  data='[
    { "category": "A", "value": 10 },
    { "category": "A", "value": 12 },
    { "category": "A", "value": 16 },
    { "category": "B", "value": 20 },
    { "category": "B", "value": 24 },
    { "category": "B", "value": 28 },
    { "category": "C", "value": 12 },
    { "category": "C", "value": 15 },
    { "category": "C", "value": 21 }
  ]'
  width=1000
  height=500
  colors='deep'
  ncolors=3
>
</dotplot>

which produces this:

Released under the MIT License. | Privacy Policy