File: example_double.py

package info (click to toggle)
mpl-scatter-density 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 5,448 kB
  • sloc: python: 661; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# TODO: this is not yet functional

import numpy as np

import matplotlib.pyplot as plt

# The following is needed to register the axes
import mpl_scatter_density  # noqa

ax = plt.subplot(1, 1, 1, projection='scatter_density')

n = 1000000
x = np.random.normal(0.5, 0.3, n)
y = np.random.normal(0.5, 0.3, n)

ax.scatter_density(x, y, color='red')

n = 1000000
x = np.random.normal(0.5, 0.2, n)
y = np.random.normal(0.5, 0.2, n)

ax.scatter_density(x, y, color='green')

plt.show()