File: embed_test.py

package info (click to toggle)
veusz 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,824 kB
  • sloc: python: 42,130; cpp: 11,268; ansic: 1,256; javascript: 788; makefile: 246; xml: 84
file content (25 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys

import numpy as N
import veusz.embed as veusz

def main(outfile):
    # note - avoid putting text in here to avoid font issues

    embed = veusz.Embedded(hidden=True)
    x = N.arange(5)
    y = x**2
    embed.SetData('a', x)
    embed.SetData('b', y)

    page = embed.Root.Add('page')
    graph = page.Add('graph')
    xy = graph.Add('xy', xData='a', yData='b', marker='square')
    graph.x.TickLabels.hide.val = True
    graph.y.TickLabels.hide.val = True
    xy.MarkerFill.color.val = 'blue'

    embed.Export(outfile)

if __name__ == '__main__':
    main(sys.argv[1])