Pylab inserts line breaks where there are nans in the data. How can I get continuous lines. I think matlab does this automatically.
example:
x = linspace(0,1,10)
y = rand(10,2)
y[5:8,1] = nan
plot(x,y,'.-')
I want y[:,1] interpolated but not y[:,0] since there are no points missing.
select the rows without
nanthen do
if you want a value from linear interpolation to substitute that
nan, you simply record the position of thatnanand do the interpolation using adjacent points, but I think for plotting purposes, simply eliminatingnandata points is enough – the code will do the linear interpolation for you anyway.btw: presumably your
y = rand((10, 50))should bey = rand(10, 50), although I am not sure why you wanna plot a 2D array against a 1D.EDIT
for your particular question, you can simply plot the two columns of
yseparately