LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change color of a certain area on plot in waveformgraph

hi all,
 
I want to change the color of a small part of the plot on my waveform graph,
is that possible?
if not, does anyone have another idea for emphasizing a small area on a waveform graph
 
Thanks,
Yael
 
0 Kudos
Message 1 of 9
(6,334 Views)

One thing you can do is to add a second plot, with a different color, over the first one.

See the attached vi, which shows how to use the NaN value to insert the superposed graph

Message Edité par chilly charly le 10-27-2005 02:03 PM

Chilly Charly    (aka CC)
Download All
Message 2 of 9
(6,325 Views)

Hi,

Thank you very much for the vi, cc. But in case I want to plot more colors on the same graph what should I do. Eg. I will increase the number of cycles to 8 and color each cycle with a different color. And more over, in my application, the data would be continiously acquiring, so when even I set a certain flag, that perticular portion of the graph should show color untill that flag is disabled.

thanks

0 Kudos
Message 3 of 9
(6,316 Views)
How do you plan to select the particular area you need to "highlight" ? Is that a fixed portion of the curve, something that may be changed dynamicaly, or is there a specific signal that will be detected ?
For a large number of highlighted zones, it would be better to use an XY plot, and to plot only the selected points, instead of the whole waveform as I did in the example above.
Chilly Charly    (aka CC)
Message 4 of 9
(6,308 Views)

I suggest you build on CC example with the following mods.

In the "normal" plot, replace the "bad" readings with NaN. this will hide the points that are bad.

In the "bad" plot use NaN for all of the "good" values.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 9
(6,297 Views)
Be careful if you use the NaN approach.  If you have large data sets, it can run you into memory problems, especially with multiple colors.  An alternate method is to chop your waveform into pieces (use Delete From Array for best memory performance, Array Subset for speed) and use waveform datatypes (or cluster) to specify the start position of each plot.  Then you don't have to use NaNs to fill in extra space.  Note that older versions of LabVIEW will cause a lot of memory copies doing this operation, as well.  7.0 and above should be fine if you are careful and use the buffer viewer to see how you are doing.
0 Kudos
Message 6 of 9
(6,281 Views)

Is there a way to "lift the pen" i.e. break the line connceting points without using NaN?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 9
(6,277 Views)
You can split your array using Split 1D Array, then plot the two arrays with specified x0 values using the cluster format (waveform will cause a copy).  This will give you a "lift pen" without causing a gap in your data.  It also won't cost you any memory copies, so should be pretty fast.
0 Kudos
Message 8 of 9
(6,245 Views)
Alternatively, you could use an intensitiy graph or a picture indicator. This gives you full control , because you get three dimensions for each point (x,y, color) if implemented correctly.
 
Have a look at my demo VI (MemoryGraph03.vi, LabVIEW 7.0) discussed at the end of this earlier thread. Maybe you can simplify it for your purpose.
Message 9 of 9
(6,237 Views)