Dim g As Graphics = PictureBox1.CreateGraphics() Dim pen As New Pen(Color.Black, 1) Dim xMin As Double = 0 Dim xMax As Double = 0.1 Dim yMin As Double = 0 Dim yMax As Double = 1000 '读取数据 Dim data() As String = IO.File.ReadAllLines("data.txt") Dim xy(data.Length - 1, 1) As Double For i As Integer = 0 To data.Length - 1 Dim temp() As String = data(i).Split(" ") xy(i, 0) = CDbl(temp(0)) xy(i, 1) = CDbl(temp(1)) Next '绘制坐标轴 g.DrawLine(pen, 0, PictureBox1.Height, 0, 0) g.DrawLine(pen, 0, PictureBox1.Height, PictureBox1.Width, PictureBox1.Height) '绘制数据点 Dim pointSize As Integer = 3 For i As Integer = 0 To xy.GetLength(0) - 1 Dim x As Integer = CInt((xy(i, 1) - xMin) / (xMax - xMin) * PictureBox1.Width) Dim y As Integer = CInt((xy(i, 0) - yMin) / (yMax - yMin) * PictureBox1.Height) g.DrawEllipse(pen, x - pointSize \ 2, PictureBox1.Height - y - pointSize \ 2, pointSize, pointSize) Next 其中,data.txt是存储数据的文件名,PictureBox1是用来显示图像的控件,可以根据需要进行修改。