For the Jython scripting, all major operations on P0D, P1D, PND are overloaded as well.
>>> from shplot import * >>> p1=p1d("test1") # build a Jython p1d based on P1D >>> p2=p1d("test2") >>> p1=p1+p2 # all values are addedNote that, for the latter operation, all y-values are added (and errors are propagated respectively), while x values remain to be the same. Note that this operation does not append the arrays, instead, use merge method.
Here are some other examples:
>>> p1=p1+p2 # all values are added >>> p1=p1-p2 # subtraction >>> p1=p1*p2 # multiplication >>> p1=p1/p2 # division >>> p1=2*p1 # scale by 2 >>> p1=p1/10 # scale by 0.1To draw objects on a canvas, one can use again "+"
>>> c1+p1 # add p1d object to the canvas c1
Similarly, one can work with one dimensional array P0D or multidimensional arrays PND.