Le vendredi 30 septembre 2011 à 17:31 +0400, Александров Петр a écrit :
> How to make a plot of a discontinuous 1d function without line at a
> function jump. An example is shown on a picture. This was plotted by:
> import numpy
> from matplotlib import pyplot
> x = numpy.linspace(-1.0, 1.0, 100)
> y = numpy.sign(x) * numpy.cos(x)
> axes = pyplot.gca()
> axes.set_ylim(-1.1, 1.1)
> pyplot.plot(x, y)

idx = (x>0)
pyplot(x[idx],y[idx])
idx = numpy.logical_not(idx)
pyplot(x[idx],y[idx])

-- 
Fabrice Silva


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to