Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One solution is to use list_plot instead of plot. plot takes a function, whereas list_plot accepts a list of (x,y) coordinates to plot. list_plot therefore gives you a bit more control and flexibility. If you replace your last three lines by:

Pabrfs= []
for r in srange (-1,1,0.25,include_endpoint=True):
    #(pi)x on Alpha off resonance Full H

list_plot (Pabrfs)

then it should work. Alternatively you can make this a bit shorter using a list comprehension:

#(pi)x on Alpha off resonance Full H
Pabrfs = [(r,Pabrf(Ratio=r).n()) for r in srange(-1,1,0.25,include_endpoint=True)]