问题描述
如题:坐标系可以显示,曲线显示不出来,是小数集合的问题吗?PointF[]P0=newPointF[11]{newPointF(0.22F,70.62F),newPointF(0.27F,77.10F),newPointF(0.37F,103.70F),newPointF(0.48F,132.40F),newPointF(0.58F,166.60F),newPointF(0.68F,217.80F),newPointF(0.79F,291.80F),newPointF(0.89F,355.60F),newPointF(1,479.20F),newPointF(1.11F,655.80F),newPointF(1.21F,912)};PointF[]I0=newPointF[11]{newPointF(0.22F,1.58F),newPointF(0.27F,1.92F),newPointF(0.37F,2.52F),newPointF(0.48F,3.16F),newPointF(0.58F,3.86F),newPointF(0.68F,4.66F),newPointF(0.79F,5.48F),newPointF(0.89F,6.44F),newPointF(1,8.10F),newPointF(1.11F,10.50F),newPointF(1.21F,14.98F)};PointF[]PFe=newPointF[11]{newPointF(0.22F,15.3F),newPointF(0.27F,20.7F),newPointF(0.37F,44.6F),newPointF(0.48F,69.8F),newPointF(0.58F,99.2F),newPointF(0.68F,143.7F),newPointF(0.79F,209.6F),newPointF(0.89F,262.2F),newPointF(1,362.3F),newPointF(1.11F,495.3F),newPointF(1.21F,640)};PointF[]Pcon=newPointF[11]{newPointF(0.22F,68.2F),newPointF(0.27F,73.5F),newPointF(0.37F,97.5F),newPointF(0.48F,122.6F),newPointF(0.58F,152.1F),newPointF(0.68F,196.6F),newPointF(0.79F,262.5F),newPointF(0.89F,315.1F),newPointF(1,415.1F),newPointF(1.11F,548.1F),newPointF(1.21F,692.9F)};gph.DrawCurve(Pens.Red,P0);gph.DrawCurve(Pens.Green,I0);gph.DrawCurve(Pens.Blue,PFe);gph.DrawCurve(Pens.Yellow,Pcon);pictureBox1.Image=bMap;
解决方案
解决方案二:
你先注释掉pictureBox1.Image=bMap;剩下的都能画出东西gph.DrawCurve(Pens.Red,P0);gph.DrawCurve(Pens.Green,I0);gph.DrawCurve(Pens.Blue,PFe);gph.DrawCurve(Pens.Yellow,Pcon);由于4条曲线x坐标基本接近0,所以画出的东西看不见.你可以试着把P0的值改一下测试看看.比如PointF[]P0=newPointF[11]{newPointF(0.22F,70.62F),newPointF(0.27F,77.10F),newPointF(100.37F,103.70F),newPointF(0.48F,132.40F),newPointF(0.58F,166.60F),newPointF(0.68F,217.80F),newPointF(0.79F,291.80F),newPointF(0.89F,355.60F),newPointF(1,479.20F),newPointF(1.11F,655.80F),newPointF(1.21F,912)};