how to access Python variables in plot function?
Steve M. Robbins <
steve@...>
2011-04-18 04:20:11 GMT
Hi,
Just discovered veusz after it was packaged and uploaded to Debian. I
really like the GUI.
I've read the manual but can't figure out how to access Python
variables in the plot functions. For example, I'd like to plot
"sin(x + offset)" where offset is a variable.
What I'm actually trying to accomplish is to create a display like
that shown in http://en.wikipedia.org/wiki/Phasor, except the sine
wave is horizontal. As a first step, I tried to create a static page
with the two plots at a given offset (30 degrees).
Using the GUI, I created the attached file page-1. Then I tried
editing to produce attached file page-2, but to no avail. Is there
documentation or examples showing the python interface?
Thanks,
-Steve
# Veusz saved document (version 1.10)
# User: steve
# Date: Mon, 18 Apr 2011 03:59:28 +0000
AddImportPath(u'/home/steve')
Add('page', name='page1', autoadd=False)
To('page1')
Add('grid', name='grid1', autoadd=False)
To('grid1')
Set('hide', False)
Set('rows', 1)
Set('scaleRows', [])
Set('scaleCols', [])
Add('polar', name='polar1', autoadd=False)
To('polar1')
Set('leftMargin', '0cm')
Set('rightMargin', '0cm')
Set('topMargin', '0cm')
Set('bottomMargin', '0cm')
Set('Border/style', u'dot2')
Set('TickLabels/hideradial', True)
Set('TickLabels/hidetangential', True)
Set('Tick/hide', True)
Add('nonorthfunc', name='nonorthfunc1', autoadd=False)
To('nonorthfunc1')
Set('function', u'30')
Set('variable', u'a')
To('..')
To('..')
Add('graph', name='graph1', autoadd=False)
To('graph1')
Set('hide', False)
Set('leftMargin', '0cm')
Set('rightMargin', '0cm')
Set('topMargin', '0cm')
Set('bottomMargin', '0cm')
Set('Border/color', u'black')
Set('Border/hide', True)
Add('axis', name='x', autoadd=False)
To('x')
Set('max', 6.2831853071800001)
Set('direction', u'horizontal')
Set('lowerPosition', 0.0)
Set('upperPosition', 1.0)
Set('otherPosition', 0.0)
To('..')
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
Add('function', name='function1', autoadd=False)
To('function1')
Set('function', u'sin(x+30.0/180.0*pi)')
To('..')
To('..')
Add('graph', name='graph2', autoadd=False)
To('graph2')
Set('hide', True)
Add('axis', name='x', autoadd=False)
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
To('..')
Add('graph', name='graph3', autoadd=False)
To('graph3')
Set('hide', True)
Add('axis', name='x', autoadd=False)
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
To('..')
To('..')
To('..')
# Veusz saved document (version 1.10)
# User: steve
# Date: Mon, 18 Apr 2011 03:39:40 +0000
offset = 30.0 * (pi/180.0)
AddImportPath(u'/home/steve')
Add('page', name='page1', autoadd=False)
To('page1')
Add('grid', name='grid1', autoadd=False)
To('grid1')
Set('hide', False)
Set('rows', 1)
Set('scaleRows', [])
Set('scaleCols', [])
Add('polar', name='polar1', autoadd=False)
To('polar1')
Set('leftMargin', '0cm')
Set('rightMargin', '0cm')
Set('topMargin', '0cm')
Set('bottomMargin', '0cm')
Set('Border/style', u'dot2')
Set('TickLabels/hideradial', True)
Set('TickLabels/hidetangential', True)
Set('Tick/hide', True)
Add('nonorthfunc', name='nonorthfunc1', autoadd=False)
To('nonorthfunc1')
Set('function', offset)
Set('variable', u'a')
To('..')
To('..')
Add('graph', name='graph1', autoadd=False)
To('graph1')
Set('hide', False)
Set('leftMargin', '0cm')
Set('rightMargin', '0cm')
Set('topMargin', '0cm')
Set('bottomMargin', '0cm')
Set('Border/color', u'black')
Set('Border/hide', True)
Add('axis', name='x', autoadd=False)
To('x')
Set('max', 6.2831853071800001)
Set('direction', u'horizontal')
Set('lowerPosition', 0.0)
Set('upperPosition', 1.0)
Set('otherPosition', 0.0)
To('..')
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
Add('function', name='function1', autoadd=False)
To('function1')
Set('function', u'sin(x+offset)')
To('..')
To('..')
Add('graph', name='graph2', autoadd=False)
To('graph2')
Set('hide', True)
Add('axis', name='x', autoadd=False)
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
To('..')
Add('graph', name='graph3', autoadd=False)
To('graph3')
Set('hide', True)
Add('axis', name='x', autoadd=False)
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
To('..')
To('..')
To('..')
_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@...
https://mail.gna.org/listinfo/veusz-discuss