I have a numeric data set that is interspersed with "-1" values. Wherever there is a "-1", I would like the graph not to plot the point, and to make a gap between the two adjacent points (not join them up).
Is there any easy way to do this? I know I can use DeletePoints to remove the points that have a value of "-1", but I'm not sure how I can make it so that the line graph is plotted discontinuously.
Igor plots a gap where the value of a wave is NaN (not a number), so you just need to replace all -1 values in your wave with NaN and then display the wave.
foo = foo[p] == -1 ? NaN : foo[p]
should work for the replacement.
Thanks - that's perfect.
aclight, where can I learn more about the syntax that you used? That functionality looks interesting, but I don't follow it.
It's in the IGOR help browser. Look for ?: in the index.
On the LHS you have a "True or false" question.
foo[p]==-1? which points in foo are equal to -1?
foo= ....... NaN : foo[p]
where the question in part 1 equates to True, set the value of foo to NaN. Where the question equates to False, leave the point as it is.
What should i do if i want to replace all values within a wave between two given points (say between point 2 and point 100) by NaN?
Just write w[2,100]=NaN
Just to be painfully clear, note that will be inclusive of points 2 and 100. If you want points between 2 and 100, exclusive of the endpoints, you want to use
w[3,99] = NAN
Apologies if this is too close to stating the obvious.
Thanks, it worked. Was really so easy!!
Back to top