Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a clean way to plot a histogram?

I have data that I have collected over an integer index. For example 0,2 1,15 2,30 3,45 4,2 I am trying to plot a nice histogram of this data using the standard 2D bar graph but they never seem to plot as I expect. The first data point is not really visible and the bars are not centered around their x values. Can such a histogram be done easily?
0 Kudos
Message 1 of 2
(2,995 Views)
You can't really center the bars over their X values because the graph is really simulating the histogram graph type. The histogram is actually made up of an XY step graph with the area underneath the curve filled to the origin and lines connecting each point to the origin as well. As far as making your first point visible as bar goes, you can make your first actual point shifted to the 2nd index in the array (or CNiVector) that you plot to the graph, but this will also require you to make your array one index bigger as well.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(2,994 Views)