/examples/d3py_scatter.py
Python | 15 lines | 13 code | 2 blank | 0 comment | 1 complexity | 4159d8ca6d72a3923a555a0b7f1712fe MD5 | raw file
- import numpy as np
- import pandas
- import d3py
- n = 400
- df = pandas.DataFrame({
- 'd1': np.arange(0,n),
- 'd2': np.random.normal(0, 1, n)
- })
- with d3py.PandasFigure(df, "example scatter plot using d3py", width=400, height=400) as fig:
- fig += d3py.Point("d1", "d2", fill="DodgerBlue")
- fig += d3py.xAxis('d1', label="Random")
- fig += d3py.yAxis('d2', label="Also random")
- fig.show()