Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

09-01-2016 06:15 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

I have some data which I would like to plot on a chart but I would also like to plot the middle section of the data in a different colour. Imagine a bell curve where the middle peak is to be a different colour so the outlier sections.

What i have done so far is to get the two regions into different arrays, now I need to combine them into the same array to plot together. However I don't know how I sync them. At the moment when I plot them the middle section is plotted from index 0 on the x axis when it needs to be shifted by an offset. I have thought about placing it into the correct index however this will result in the ends being plotted as zeroes which is unwanted.

Thanks

Stephen

Labview 14.0, Labview 12.0

CLAD

Mechanical Engineering Student

CLAD

Mechanical Engineering Student

Highlighted
Options

09-01-2016 06:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Common pitfall: rigth click on the graph and disable 'ignore timestamp'

or

convert all datapoints to xy data and plot it with a xy-graph or a mixed-graph

more help if you attach your example vi with example data 🙂

Greetings from Germany

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Highlighted
Options

09-01-2016 06:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi , thanks for your help. Unfortunately the data doesn't have a timestamp. the frequency is know and that what I'm using to plot. I'm not using the absolute time just relative time - the date was captured at 1000hz.

As for the xy graph solution, how would i go about creating a coloum of integers for the x axis.

thanks

Stephen

Labview 14.0, Labview 12.0

CLAD

Mechanical Engineering Student

CLAD

Mechanical Engineering Student

Highlighted
Options
The waveform graph also accepts a cluster of an initial x value, a delta x value, and a 2D array of y data. The graph interprets the y data as points on the graph and increments the x index by delta x, starting at the initial x value. This data type is useful for displaying multiple signals that are sampled at the same regular rate.

-Looks this method might work and use the initial X value to shift the graph :http://zone.ni.com/reference/en-XX/help/371361M-01/lvconcepts/types_of_graphs_and_charts/#Waveform_G...

09-01-2016 06:51 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

-Looks this method might work and use the initial X value to shift the graph :http://zone.ni.com/reference/en-XX/help/371361M-01/lvconcepts/types_of_graphs_and_charts/#Waveform_G...

Thanks

uday

uday

Highlighted
Options

09-01-2016 07:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

The "trick" to plotting a set of data using different colors for different sets of points is to realize that (a) you can't do it in LabVIEW, as a plot has a "defined color" for the entire set of points, so (b) you need to "cheat" a little and plot it twice.

Let's assume you have an array "Red Data" of Dbls (you need to use Floats for this, so if your data are integers, you'll need to copy them to a Dbl array. Make a copy of Red Data, call it Green Data. Now set Red Data to plot using Red points, and Green Data to plot using Green Points. If you plot them both, the points will sit "on top of" each other, and whichever is plotted last will show up, not what you want.

So now you need to "disappear" the Red Data points that should be Green, and the Green Data Points that should be Red. Make a third, Boolean, array called "Red", and set it True if you want a Red point, and False if you want a Green point. Now, in a For loop, process all three Arrays. If Red is True, set the Green Data point to NaN (Not a Number) and the Red Data point to itself (i.e. "preserve it), while if Red is False, set the Red Data point to NaN and Green Data to itself. Now plot both Red Data and Green Data. The NaN data points don't plot, so each position gets __either__ a Red Data or Green Data point, as you specify.

Bob Schor

Highlighted
Options

09-02-2016 01:32 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

One annoying part of two plots with NaN is the gap you have if you just sort the points to 2 colors (see top graph)

so I would suggest easy mod to just add colored points , see the lower solution.

or share one point in both plots.... or simply overlay ( play with the plot properties)

How many ideas have already been posted to motivate NI to have a graph with a color ramp plot?

Greetings from Germany

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Highlighted
Options

09-02-2016 03:57 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thank you all for the suggestions. Creating two arrays and then bundling into a waveforem cluster seems to work the best.

Thanks

Stephen

Labview 14.0, Labview 12.0

CLAD

Mechanical Engineering Student

CLAD

Mechanical Engineering Student