01-11-2010 11:20 AM
Hello all,
I have a 3000 point waveform graph showing a series of peaks. For one of these peaks, for which I know the starting and ending indices, I would like to programmatically draw a filled box under the waveform on the graph, to highlight it's position. I can't figure out if there is a way to do this.
I have figured out how to draw cursors at the begin and end, but ultimately I do this for multiple peaks, and the forest of cursors rapidly becomes confusing. A simple shaded box would work far better.
Any ideas?
Many thanks in advance,
RipRock99
Solved! Go to Solution.
01-11-2010 11:34 AM
Hi RipRock,
which LV version do you use?
2 options come to my mind:
- make the background of thegraph transparent, puta picture indicator behind it and draw rectangle here (suitable for older LV versions)
- use the possibility to put pictures "into" the graph and draw rectangles here (for LV8+ AFAIK, property PlotImages [Front, Middle, Back])
01-11-2010 12:00 PM
is it something like this
01-11-2010 01:19 PM
01-11-2010 01:20 PM
Whoops - OK - I can't see the 8.6 vi. Can you downgrade it to 8.5.1 or take a picture of it?
Thanks!
01-12-2010 02:20 AM
01-12-2010 10:33 AM
Big Thanks GerdW!
The LV code was very close to what I wanted to do, and was easy to use to determine how to make my code produce the result I sought. Basically, I added another waveform to my graph, using my known x-indices to set the Y values for the areas I wanted to be gray as +infinity, and the leaving the remainder at = -infinity. I then plotted this second graph on top of the original waveform, and used the property node to set the fill flag to -infinity.
This doesn't answer the general question of how to draw a filled box with known coordinates on a graph, but this does solve what I wanted to achieve!
Well done, and thanks,
RipRock99
PS: I include a snapshot of the result, and a snapshot of the code used to set the property node programmatically. I don't include my whole code as it is way complicated, and I would also need to add a big dataset. Hope the pictures are enough to help anyone else referencing this board!
01-12-2010 10:39 AM
Here are those links as inline images. Apologies - I didn't quite see how to do this in the previous post.
Here is the property node code:
And here is the result: