From: Peter G. <pgr...@ge...> - 2004-04-05 21:23:28
|
Hi everyone: I was wondering whether it is possible to tell matplotlib how/when to connect data points. Consider this simple script: from matplotlib.matlab import * figure(1) t = [0,1,2,3,4,5,105,106,107] s = [1,4,5,3,9,11,-5,-8,3] plot(t, s, antialiased=False) grid(True) show() There are no data points between t=5 and t=105. By default the points (5,11) and (105,-5) are connected, but I would like to tell matplotlib NOT to do so. In my case I would like to pass the plot function a variable telling it what to do. So for example would have: plot(t, s, max_delta=40) This would mean that the points are only to be connected if the difference between the adjacent t values is less than 40. In my case this is relevant because sometimes there are "holes" in my data, and connecting the points makes the plots look very messy. Would anyone find something like this useful? Would it be difficult to implement? Thanks. Peter |