Page 1 of 1

Need help for histogram

Posted: Tue Mar 16, 2010 8:48 am
by 15654593
Hi,

Can someone help mewith this? I need to plot a histogram with a double arrray of data using C#? But i don't know how to do it. Can someone tell me? Thanks
I want to plot it like matlab function hist(a), where a is the double array data.
Thank.

Regards,
Nicholas

Re: Need help for histogram

Posted: Tue Mar 16, 2010 11:30 am
by yeray
Hi Nicholas,

Have you seen the examples from the "Features Demo" and the tutorials? You should find them at TeeChart's program group. The Add method accepts arrays:

Code: Select all

        private void InitializeChart()
        {
            chartController1.Chart = tChart1;

            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.Histogram histo1 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);

            double[] Values = new double[40];
            Random rnd = new Random();
            for (int i = 0; i < 40; i++)
            {
                Values[i]=rnd.Next(100);
            }

            histo1.Add(Values);
        }

Re: Need help for histogram

Posted: Wed Mar 17, 2010 3:21 am
by 15654593
Hi,

I have seen the example. I can't find the tutorial. Can you tell me how to perform histogram function? I have a very large data. I only want to plot -15 to 15, numbit of 10. How can i do it? Thanks.

Regards,
Nicholas

Re: Need help for histogram

Posted: Wed Mar 17, 2010 9:35 am
by yeray
Hi Nicholas,

I thought you wanted to draw a histogram series. Now I understand you have a series and you want to calculate and draw the histogram function from it.
You can see an example of it in the Feature demo, concretely the All Features\Welcome !\Functions\Statistical\Histograms example.
You should find shortcuts to both the Feature demo program and the tutorials through Start Menu\Steema TeeChart for .NET 2009\

Re: Need help for histogram

Posted: Thu Mar 25, 2010 1:42 pm
by 13051218
Where can I find an example written on VB?. I've spent the last couple of hours trying to make it work and I can't.

By the way, I just want to construct a histogram out of a graph series and control the numbers of intervals or range

Thank you

Re: Need help for histogram

Posted: Thu Mar 25, 2010 5:02 pm
by yeray
Hi Yacu,

There is a Features demo version in VB in the Examples/DemoProjectVB folder into your TeeChart installation folder. By default:
C:\Program Files\Steema Software\TeeChart for .NET 2009\Examples\DemoProjectVB
And concretely the Histogram funcition example should be at:
C:\Program Files\Steema Software\TeeChart for .NET 2009\Examples\DemoProjectVB\Functions\Function_Histogram.vb

Re: Need help for histogram

Posted: Thu Mar 25, 2010 5:13 pm
by 13051218
Yeray:

Thanks for your reply, I had lost the examples and now I've reinstalled them and solved the inquiry

Re: Need help for histogram

Posted: Mon Jul 26, 2010 3:13 pm
by 10545706
i notice the original question mentioned matlab's hist() function. i am perplexed as to why THistogramFunction produces results that are very different from matlab's hist(). does anyone know why? (i have been playing with 6500 data points, trying to figure out why my polar plots in TChart 8.07 are so different from those in matlab (any version 6.5 to current), and the root of the problem is the binning algorithm used by the histogram function.)

Re: Need help for histogram

Posted: Wed Jul 28, 2010 2:53 pm
by yeray
Hi Philip,

Please, see my reply here