'picture图片可任意大小 Public Sub huaxian(byval pic as object) pic.Cls pic.Scale (-2 * x - x / 2, 2 * x + x / 2)-(2 * x + x / 2, -2 * x - x / 2) '规定picture大小 pic.Line (-2 * x, 0)-(2 * x, 0) '画x轴 pic.Line (0, 2 * x)-(0, -2 * x) '画y轴 pic.Line (-2 * x, 2 * x)-(-2 * x, -2 * x) '画边框 pic.Line (-2 * x, -2 * x)-(2 * x, -2 * x) pic.Line (2 * x, -2 * x)-(2 * x, 2 * x) pic.Line (-2 * x, 2 * x)-(2 * x, 2 * x) For i = -x To x Step x / 4 'X轴坐标标定 pic.Line (2 * i, -2 * x)-(2 * i, -2 * x + x / 8) pic.CurrentX = i * 2 - x / 6 pic.CurrentY = -2 * x - x / 6 pic.Print Format(i, "0.0°") Next i
For i = -y To y Step y / 8 'Y轴坐标标定 pic.Line (-2 * x, 2 * x / y * i)-(-2 * x + x / 8, 2 * x / y * i) pic.CurrentX = -x / 2.5 - 2 * x pic.CurrentY = (i + 0.2) * (2 * x / y) 'y轴坐标扩大4倍 pic.Print Format(i, "0.0") Next i
Public Sub huaxian(byval pic as object)
pic.Cls
pic.Scale (-2 * x - x / 2, 2 * x + x / 2)-(2 * x + x / 2, -2 * x - x / 2) '规定picture大小
pic.Line (-2 * x, 0)-(2 * x, 0) '画x轴
pic.Line (0, 2 * x)-(0, -2 * x) '画y轴
pic.Line (-2 * x, 2 * x)-(-2 * x, -2 * x) '画边框
pic.Line (-2 * x, -2 * x)-(2 * x, -2 * x)
pic.Line (2 * x, -2 * x)-(2 * x, 2 * x)
pic.Line (-2 * x, 2 * x)-(2 * x, 2 * x) For i = -x To x Step x / 4 'X轴坐标标定
pic.Line (2 * i, -2 * x)-(2 * i, -2 * x + x / 8)
pic.CurrentX = i * 2 - x / 6
pic.CurrentY = -2 * x - x / 6
pic.Print Format(i, "0.0°")
Next i
For i = -y To y Step y / 8 'Y轴坐标标定
pic.Line (-2 * x, 2 * x / y * i)-(-2 * x + x / 8, 2 * x / y * i)
pic.CurrentX = -x / 2.5 - 2 * x
pic.CurrentY = (i + 0.2) * (2 * x / y) 'y轴坐标扩大4倍
pic.Print Format(i, "0.0")
Next i