LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot a 2d array as a bar plot

Solved!
Go to solution

Hi

 

Something seemingly simple yet I can not seem to solve it quickly enough...

I would like to plot a 2D array in a bar plot.

My array can looks like this

0.24   12

0.36   20

0.55   30

0.83   20

0.94   35

1.23     4

 

The first column would be representing the x-axis and the second column is intended to be the height of the bar.

 

Would appreciate any suggestions you may have!

Thanks

 

Jack

0 Kudos
Message 1 of 4
(4,983 Views)

Hi again

 

Just an update... I managed to split the 2D array into two 1D arrays and then bundled them which works by then feeding it to a XY graph.

With the plot bar option it does display what I have in mind but it connects the bar with lines in between which is distracting.

Any suggestions on how I can avoid the lines or a smarter way to do it?

 

Many thanks!

 

Jack

0 Kudos
Message 2 of 4
(4,977 Views)
Solution
Accepted by topic author JTRI

Hi again

 

Apologies for answering my own questions but I thought this may be useful to others too and I have a deadline hence my earlier post....

I just googled to find an answer to solve the problem of lines between the bars and found the following blog which explained exactly what to do:

 

http://www.speedvi.com/everything-labview-related/how-to-make-a-bar-graph-without-joining-lines-in-l...

 

In short:

First, click on the Plot Legend, select ‘Common Plots’ and then the bottom right option from the drop down list.

Second, select ‘Bar Plots’ lower down in the plot menu, make the appearance change.

Last, in the ‘Interpolation’ menu specifically select the first item(the top-left one, which has no lines).

It helped me, hope it will be of use to others.

 

Have a good day!

 

Jack

Message 3 of 4
(4,976 Views)

HI,

 

Check it out....

In plot legent -> common plot 5th option

                          Barplots 3rd option

 

Split the 2D array in to two 1D arrays and make it as a cluster and feed it into XY Graph.

 

Kudos are welcome....

Message 4 of 4
(4,971 Views)