I have some code that works, but it draws the lines manually and is not particularly elegant:
Code: Select all
w=h.Graph()
w.size(0, totalLength, 0, 2)
w.color(1)
w.label('cai')
w.color(2)
w.label('ip3i')
for i in range(1, numPlots+1):
# advance to next time point to plot
h.cvode.solve(i*plotEvery)
# calcium curve
w.color(1) # black
w.beginline()
for seg in stick:
w.line(seg.x*totalLength, 1000*seg.cai)
# IP3 curve
w.color(2) # red
w.beginline()
for seg in stick:
w.line(seg.x*totalLength, 1000*seg.ip3i)
# update display
w.flush()
Code: Select all
w=h.Graph()
w.size(0, totalLength, 0, 2)
w.color(1)
w.addexpr('cai','cai(x)*1000')
w.color(2)
w.addexpr('ip3i','ip3i(x)*1000')
stick.push()
w.family(1)
for i in range(1, numPlots+1):
# advance to next time point to plot
h.cvode.solve(i*plotEvery)
# plot the curves
for seg in stick:
h('x=%f' % (seg.x))
w.plot(seg.x*totalLength)
w.begin()
A related question: when I'm done, I want to save the graph. I use w.printfile('output.ps'). Problem: It cuts off the bottom labels. How do I get it to not do that?
Thanks.