我想使用FSharpChart,但我没有基本的图表来显示:相关矩阵。
因此,我写了一些函数来绘制位图,就像Tomas Petricek绘制饼图一样。
有没有简单的方法让我使用它来扩展FSharpChart?
let drawCorrelation (udls:seq<'T>) (mapcorrel:Map<('T*'T), float>) =
let mainForm = new Form(Width = 1250, Height = 1050, Text = "Correlation matrix")
let boxChart = new PictureBox(BackColor = Color.White, Dock = DockStyle.Fill,SizeMode = PictureBoxSizeMode.CenterImage)
let matrixbm = new Bitmap(1200, 1000)
let gr = Graphics.FromImage(matrixbm)
gr.Clear(Color.White)
draw2D gr (drawCorrelationInner mapcorrel) 1200 1000 udls mapcorrel (mapcorrel |> Seq.map (fun kv -> kv.Value ) |> Seq.average)
boxChart.Image <- matrixbm
mainForm.Controls.Add(boxChart)
mainForm.Show()