正态分布的C#绘图 [英] C# Plotting of a Normal Distribution

查看:609
本文介绍了正态分布的C#绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试在C#中实现图形.我下载了ZedGraph库,试图找出一种实现要求的方法,但是在尝试绘制正态分布(钟形曲线)时已经陷入困境.

要求如下:
我需要能够从以下公式中绘制标准正态分布:

Hi everyone,

I am trying to implement a graph in C#. I downloaded the ZedGraph library and tryed to figure out a way to implement the requirements but already got stuck when trying to plott a Normal Distribution (bell curve).

The requirements are following:
I need to be able to plott a Standard Normal Distribution out of the following formulae :

y = (double)(1/Math.Sqrt(2 * Math.PI)) * Math.Exp((double)(-1/2) * Math.Pow(x, 2))



...并经过一些计算-为曲线的范围着色以可视化概率.

现在我不确定如何可视化所有这些东西,因为数据是连续的,而不仅仅是一组离散数据.

非常感谢您的帮助.

干杯,
Haris



... and after some calculation - color a range of the curve to visualize a probability.

Now I am not sure how to visualize all of that stuff as the data is continuous and not only a set of discrete data.

I would really appreciate your help.

Cheers,
Haris

推荐答案

也许您不应该尝试使用通用库,它们通常是针对业务方面的.您可以在WinForms或WPF中手动进行操作.两者都支持绘图线.在WPF中,您可以使用画布,并在画布上绘制线条: http://msdn.microsoft.com /en-us/library/ms747393.aspx [ ^ ].互联网上应该有很多资源可以告诉您如何使用WinForms或WPF进行绘制.
Maybe you should not be trying to use a general purpose library, they usually are oriented towards business grahics. You can manually do it in WinForms or WPF. Both support drawing lines. In WPF you can use the canvas, and draw lines on the canvas: http://msdn.microsoft.com/en-us/library/ms747393.aspx[^]. there should be quite a few resources available on the internet to tell you how to do drawing, either in WinForms or WPF.


这篇关于正态分布的C#绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆