PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/d3py_scatter.py

https://github.com/followyourheart/d3py
Python | 15 lines | 13 code | 2 blank | 0 comment | 1 complexity | 4159d8ca6d72a3923a555a0b7f1712fe MD5 | raw file
  1. import numpy as np
  2. import pandas
  3. import d3py
  4. n = 400
  5. df = pandas.DataFrame({
  6. 'd1': np.arange(0,n),
  7. 'd2': np.random.normal(0, 1, n)
  8. })
  9. with d3py.PandasFigure(df, "example scatter plot using d3py", width=400, height=400) as fig:
  10. fig += d3py.Point("d1", "d2", fill="DodgerBlue")
  11. fig += d3py.xAxis('d1', label="Random")
  12. fig += d3py.yAxis('d2', label="Also random")
  13. fig.show()