I am a matplotlib noob, but I have searched the documentation, lists etc and cannot find a simple way to stop a curve being drawn once it crosses another curve. In the attached example, I am trying to draw the solid curve only until it intersects the dashed one. I have tried using the numpy.where() method, but it does not seem to be the right way to go about it- I end up having to write FOR loops and so on, and that does not make use of the vectorization advantages of numpy. Seems like there ought to be a simple way to do this.
Gordon mport numpy as np import matplotlib.pyplot as plt def ig_CRM(vg,V,L,Ts): return ((Ts*vg/(2*L))*(1-(vg/V))) def ig_CCM(vg,V,L,Ts,d): return (Ts*vg*d**2/(2*L))/(1-vg/V) L= 110*10**-6 Ts= 10**-5 V= 400 vg= np.arange(0.0,400.0,1.0) ig_bdry= ig_CRM(vg,V,L,Ts) plt.plot(vg,ig_bdry,'--') ig_d2=ig_CCM(vg,V,L,Ts,0.2) plt.plot(vg,ig_d2) plt.axis([0, 400, 0, 20]) plt.show() ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users