>>>>> "Tom" == Tom Denniston <[EMAIL PROTECTED]> writes:
Tom> When you do a line scatter plot in excel and data is missing
Tom> between two observations excel doesn't connect those two
Tom> observations with a line. So what you see is a line with
Tom> gaps where the data is missing. Missing data is defined as
Tom> having x values but no y value or vice versa. Is there a
Tom> good way to get similar behavior in matplotlib?
This from examples/masked_demo.py
#!/bin/env python
'''
Plot lines with points masked out.
This would typically be used with gappy data, to
break the line at the data gaps.
'''
import matplotlib.numerix.ma as M
from pylab import *
x = M.arange(0, 2*pi, 0.02)
y = M.sin(x)
y1 = sin(2*x)
y2 = sin(3*x)
ym1 = M.masked_where(y1 > 0.5, y1)
ym2 = M.masked_where(y2 < -0.5, y2)
lines = plot(x, y, 'r', x, ym1, 'g', x, ym2, 'bo')
setp(lines[0], linewidth = 4)
setp(lines[1], linewidth = 2)
setp(lines[2], markersize = 10)
legend( ('No mask', 'Masked if > 0.5', 'Masked if < -0.5') ,
loc = 'upper right')
title('Masked line demo')
savefig('test.svg')
#savefig('test.ps')
show()
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users