How can I get the all intersecting points between curve and straight line

49 views
Skip to first unread message

Nurunnabi Sordar

unread,
Dec 19, 2016, 11:21:23 PM12/19/16
to Python Pune
from matplotlib import pyplot as mp
import numpy as np

# draw vertical line
p1=mp.axvline(x=10, ymin=0, ymax=1,linewidth = 2, color =  'black')
p2=mp.axvline(x=20, ymin=0, ymax=1,linewidth = 2, color =  'black')
p3=mp.axvline(x=30, ymin=0, ymax=1,linewidth = 2, color =  'black')
p4=mp.axvline(x=40, ymin=0, ymax=1,linewidth = 2, color =  'black')
p5=mp.axvline(x=50, ymin=0, ymax=1,linewidth = 2, color =  'black')
p6=mp.axvline(x=60, ymin=0, ymax=1,linewidth = 2, color =  'black')
p7=mp.axvline(x=70, ymin=0, ymax=1,linewidth = 2, color =  'black')
p8=mp.axvline(x=80, ymin=0, ymax=1,linewidth = 2, color =  'black')
p9=mp.axvline(x=90, ymin=0, ymax=1,linewidth = 2, color =  'black')
p10=mp.axvline(x=100, ymin=0, ymax=1,linewidth = 2, color =  'black')
A2 = 400
sig = 1 / (1.5 * 13)
x = np.linspace(0, .8, 100)
def gaussian(x, mu, sig):
    return np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.))) * A2


for mu in (0, 0.083, .16, .24, .33, .41, .49, .58, .66, .74, .83, .91, .96, 1):
    ax= mp.plot(gaussian(x, mu, sig))

mp.show()


Sachet Mittal

unread,
Dec 20, 2016, 3:56:22 AM12/20/16
to pytho...@googlegroups.com
Hi,

I have not used matplotlib/numby very much but this seems like it would get you started on the right path:



Regards,
Sachet Mittal

--
You received this message because you are subscribed to the Google Groups "Python Pune" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonpune+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages