Dot plot Example#

Here shows how to draw dot plot

import numpy as np
import milkviz as mv

First let’s create some random data#

shape = (10, 3)
colors = np.repeat([['#3A3226', '#CB1B45', '#F75C2F']], 10, axis=0)
sizes = np.random.randint(1, 100, shape)
matrix = np.random.randint(1, 100, shape)
labels = ["apple", "banana", "Coconut", "Plum", "Kiwifruit",
          "Mango", "Papaya", "Persimmon", "Quince", "Soursop"]

Create the dot heatmap#

mv.dot_heatmap(sizes, colors, yticklabels=labels,
               dot_size_legend_kw={"title": "Size"})
plot dot
<milkviz._dot_matrix.DotHeatmap object at 0x7f2cb4aa83a0>

Total running time of the script: ( 0 minutes 0.398 seconds)

Gallery generated by Sphinx-Gallery