pyx

Drawing braces with Pyx

最后都变了- 提交于 2019-12-03 21:35:12
How can I draw a “braced” line between two arbitrary points with Pyx? It would look something like this: Brace example http://tof.canardpc.com/view/d16770a8-0fc6-4e9d-b43c-a11eaa09304d You can draw pretty braces using sigmoidals . I don't have Pyx installed so I'll just plot these using matplotlib (pylab here). Here beta controls the sharpness of the curves in the braces. import numpy as nx import pylab as px def half_brace(x, beta): x0, x1 = x[0], x[-1] y = 1/(1.+nx.exp(-1*beta*(x-x0))) + 1/(1.+nx.exp(-1*beta*(x-x1))) return y xmax, xstep = 20, .01 xaxis = nx.arange(0, xmax/2, xstep) y0 =