Debian Codegraph @

examples/custom_data.py

raw symbols SCIP
1 import leather
2
3 data = [
4 {'x': 0, 'q': {'y': [3]}},
5 {'x': 4, 'q': {'y': [5]}},
6 {'x': 7, 'q': {'y': [9]}},
7 {'x': 8, 'q': {'y': [4]}},
8 ]
9
10
11 def x(row, index):
12 return row['x']
13
14
15 def y(row, index):
16 return row['q']['y'][0]
17
18
19 chart = leather.Chart('Line')
20 chart.add_line(data, x=x, y=y)
21 chart.to_svg('examples/charts/custom_data.svg')