From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot a graph with the value distribution in percent

Solved!
Go to solution

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
Percentile.PNG

 

0 Kudos
Message 1 of 12
(1,329 Views)

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

0 Kudos
Message 2 of 12
(1,327 Views)

Here's one possibility....

 

altenbach_0-1653663576683.png

 

0 Kudos
Message 3 of 12
(1,323 Views)

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.

0 Kudos
Message 4 of 12
(1,286 Views)

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.

0 Kudos
Message 5 of 12
(1,282 Views)

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

 

altenbach_0-1653685502891.png

 

0 Kudos
Message 6 of 12
(1,272 Views)

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.

0 Kudos
Message 7 of 12
(1,259 Views)

@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
0 Kudos
Message 8 of 12
(1,246 Views)

@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
0 Kudos
Message 9 of 12
(1,243 Views)

@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. 😄

0 Kudos
Message 10 of 12
(1,234 Views)