# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Plot a graph with the value distribution in percent

Hello,

Is there an easy option to plot a graph with the value distribution in percent. I want to get something similar to in the picture. If I try to make myself, it will be big and chaos. Thanks

Message 1 of 12
(1,344 Views)

## Re: Plot a graph with the value distribution in percent

You can change the format of the markers accordingly, e.g. "%.0f%%" (use the advanced formatting option)

Message 2 of 12
(1,342 Views)

## Re: Plot a graph with the value distribution in percent

Here's one possibility....

Message 3 of 12
(1,338 Views)

## Re: Plot a graph with the value distribution in percent

These are the rms of weighted values. I have to show the percentage of each value from the list. I was thinking maybe there is a built-in function which is like histogram, but more specific to my need, then I don't have to program it.

Message 4 of 12
(1,301 Views)

## Re: Plot a graph with the value distribution in percent

Well, your problem description was not clear at all, because I took it as a cosmetic problem. To calculate a normalized integral, that would be an easy data operation. Start by attaching some simple data.

Message 5 of 12
(1,297 Views)

## Re: Plot a graph with the value distribution in percent

See if this can give you some ideas....

Message 6 of 12
(1,287 Views)

## Re: Plot a graph with the value distribution in percent

That's exactly what I need, but the code isn't quite clear. Could you please elaborate or upload an example if don't mind.

Message 7 of 12
(1,274 Views)

## Re: Plot a graph with the value distribution in percent

@mub.re wrote:

These are the rms of weighted values. I have to show the percentage of each value from the list. I was thinking maybe there is a built-in function which is like histogram, but more specific to my need, then I don't have to program it.

Well, there is a built in function like that.  Surprisingly it is titled Histogram.vi

Altenbachs code is simply faster.

"Should be" isn't "Is" -Jay
Message 8 of 12
(1,261 Views)

## Re: Plot a graph with the value distribution in percent

@mub.re wrote:

These are the rms of weighted values. I have to show the percentage of each value from the list. I was thinking maybe there is a built-in function which is like histogram, but more specific to my need, then I don't have to program it.

Well, there is a built in function like that.  Surprisingly it is titled Histogram.vi

Altenbachs code is simply an extremely efficient way to scale and sum the counts of the bin outputs after passing the raw values through a histogram.

"Should be" isn't "Is" -Jay
Message 9 of 12
(1,258 Views)

## Re: Plot a graph with the value distribution in percent

@mub.re wrote:

That's exactly what I need, but the code isn't quite clear. Could you please elaborate or upload an example if don't mind.

The quality of my answer cannot be significantly better than the quality of the question (well, sometime I guess right and it is!).

Apparently, you have several analysis steps:

1. Calculating a histogram of the raw data
2. calculating the integral of the histogram
3. Graphing both 1&2
4. Displaying the axis markers containing a percentage sign.

Initially, I thought you needed help with #4. Later I added a solution for 2&3, still assuming that you already have the histogram data. Now you are telling me that you also need help with #1. Who could have guessed!!!

I have asked you to attach some typical data, which you did not do, but would have cleared things up. I am not clairvoyant! Once you decide to attach some data, I will attach the full solution. Until then, it is a waste of my time to keep guessing what your problem really is.

Yes, LabVIEW has built-in functions to calculate histograms, but I would recommend an even simpler solution. What is the data range (0 to 0.1??)? How many bins do you want (100?)? Do you also need a bin for values that are outside the range? No matter what, the code is trivial and probably fits on a postage stamp. 😄

Message 10 of 12
(1,249 Views)