/examples/d3py_area.py
Python | 21 lines | 18 code | 3 blank | 0 comment | 1 complexity | 39417ed3f55fa00c8a7c7b3ef3c6eeb8 MD5 | raw file
- import numpy as np
- import d3py
- import pandas
- N = 500
- T = 5*np.pi
- x = np.linspace(-T,T,N)
- y = np.sin(x)
- y0 = np.cos(x)
- df = pandas.DataFrame({
- 'x' : x,
- 'y' : y,
- 'y0' : y0,
- })
- with d3py.PandasFigure(df, 'd3py_area', width=500, height=250) as fig:
- fig += d3py.geoms.Area('x', 'y', 'y0')
- fig += d3py.geoms.xAxis('x')
- fig += d3py.geoms.yAxis('y')
- fig.show()