Need help for histogram

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
nicholasamh
Newbie
Newbie
Posts: 8
Joined: Wed Nov 04, 2009 12:00 am

Need help for histogram

Post by nicholasamh » Tue Mar 16, 2010 8:48 am

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Need help for histogram

Post by Yeray » Tue Mar 16, 2010 11:30 am

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);
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

nicholasamh
Newbie
Newbie
Posts: 8
Joined: Wed Nov 04, 2009 12:00 am

Re: Need help for histogram

Post by nicholasamh » Wed Mar 17, 2010 3:21 am

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Need help for histogram

Post by Yeray » Wed Mar 17, 2010 9:35 am

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\
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yacu
Newbie
Newbie
Posts: 31
Joined: Tue Dec 23, 2008 12:00 am

Re: Need help for histogram

Post by Yacu » Thu Mar 25, 2010 1:42 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Need help for histogram

Post by Yeray » Thu Mar 25, 2010 5:02 pm

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
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yacu
Newbie
Newbie
Posts: 31
Joined: Tue Dec 23, 2008 12:00 am

Re: Need help for histogram

Post by Yacu » Thu Mar 25, 2010 5:13 pm

Yeray:

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

philip
Newbie
Newbie
Posts: 15
Joined: Tue Jun 26, 2007 12:00 am

Re: Need help for histogram

Post by philip » Mon Jul 26, 2010 3:13 pm

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.)

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Need help for histogram

Post by Yeray » Wed Jul 28, 2010 2:53 pm

Hi Philip,

Please, see my reply here
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply