散点图中的线性与非线性关系

散点图中的线性与非线性关系
几何画板及绘图内容加载中,请稍等……
2023-04-27 21:18
本范例通过散点图展示线性与非线性关系,帮助学生识别数据集中的线性与非线性趋势。使用了Shuffle, Element, If, Point, Append, Slope, Text, Translate等GeoGebra命令。适合6-8年级学生学习数据关系识别。

GeoGebra 命令及参数

  1. Shuffle(Sequence[0, 1.25, 0.25]) → randomb, {0, 1.25, 0.5, 0.25, 0.75, 1}
  2. Shuffle(Flatten[Sequence[{1, 2, 3, 4}, ii, 1, 5]]) → randomList1, {1, 4, 3, 4, 1, 4, 4, 1, 3, 2, 2, 2, 2, 1, 4, 3, 3, 3, 2, 1}
  3. Element(randomList1, Mod[countQuestion, Length[randomList1]] + 1) → randomNum1
  4. Shuffle(Sequence[4] \ {randomNum1}) → RanPositionsOrder, {3, 2, 4}
  5. Shuffle(Sequence[0, 3, 0.1] \ {Element[Sequence[0, 3, 0.1], Mod[countQuestion, 5] + 1]}) → randomList2, {2.4000000000000004, 1.8000000000000007, 2.1, 0.5, 0.8999999999999999, 2, 0.7, 2.3000000000000003, 1, 0.7999999999999999, 0.1, 1.2000000000000002, 1.7000000000000006, 1.1, 1.4000000000000004, 1.6000000000000005, 1.5000000000000004, 2.5000000000000004, 1.3000000000000003, 0.4, 2.6000000000000005, 2.7000000000000006, 1.9000000000000008, 2.2, 2.8000000000000007, 3, 0.2, 0.6, 2.900000000000001, 0.30000000000000004}
  6. Shuffle(Sequence[2, 4]) → randomn, {4, 3, 2}
  7. Shuffle(Sequence[0.5, 3, 0.25]) → randomm, {0.5, 1.75, 2, 1, 1.5, 2.25, 0.75, 2.75, 1.25, 2.5, 3}
  8. Shuffle(Flatten[Sequence[Sequence[0, 0.25, 0.05], ii, 1, 5]]) → randomErrors, {0.15000000000000002, 0, 0.25, 0.2, 0, 0.05, 0.05, 0, 0.1, 0.25, 0.05, 0.2, 0, 0.15000000000000002, 0.25, 0.05, 0, 0.15000000000000002, 0.1, 0.15000000000000002, 0.1, 0.2, 0.1, 0.25, 0.2, 0.25, 0.15000000000000002, 0.2, 0.1, 0.05}
  9. If(randomNum1 ≠ 1, 3 - Element[randomb, Mod[countQuestion, Length[randomb]] + 1], Element[randomb, Mod[countQuestion, Length[randomb]] + 1]) → intercept
  10. Point(yAxis) → F
  11. Append(randomNum1, RanPositionsOrder) → RanPosOrderComplet
  12. Element(randomn, Mod[countQuestion, 3] + 1) → coeffn
  13. Slope(Line[G, H]) → slope
  14. Text((((intercept * "-") * slope) * "x")) → expressionQ11
  15. Text((((intercept * "+") * slope) * "y")) → expressionQ1
  16. Translate(Polygon[{F, F - (0, hei), F + (wid, (-hei)), F + (wid, 0)}], (0, -0.07)) → droparea
  17. TableText(Append[Flatten[Sequence[{"\hspace{-10}y", "\hspace{-10}\times"}, i, 1, coeffn - 1]], "\hspace{-10}y"]) → tableQ9
  18. Element(randomList2, Mod[countQuestion, 15] + 1) → randomNum2
  19. Textfield(input1) → InputBox1
  20. Textfield(input2) → InputBox2
  21. Corner(5) → layoutAppSize
  22. onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5]) → OnboardingTextOffset
  23. Sequence((3 + ini, 1.35 + (ii * 0.55) - hei), ii, 0, 3) → l2
  24. Sort(l2, RanPosOrderComplet) → PositionsOrder
  25. Vertex(droparea, 2) → P
  26. Zip((("\textsf{" * TT) * "}"), TT, {"POSITIVE LINEAR RELATION", "NEGATIVE LINEAR RELATION", "NONLINEAR RELATION", "NO CORRELATION"}) → Options
  27. Segment((0, 0), (3, 0)) → fakexAxis
  28. Segment((0, 0), (0, 3)) → fakeyAxis
  29. Translate(vGL, Vector[(Vector[Corner[1], Corner[2]] / 800 * 32)]) → vGL'
  30. KeepIf(0.1 ≤ y(PP) ≤ 2.9, PP, Zip[(ii, (slope * ii) + intercept + ee), ii, randomList2, ee, randomErrors]) → linCoScatter
  31. KeepIf(0.1 ≤ y(PP) ≤ 2.9, PP, Zip[(ii, f1(ii) + ee), ii, randomList2, ee, randomErrors]) → nonlinScatter
  32. Text("\bold{x}", (3.2, -0.07), true, true, 0, 1) → labelx
  33. Text("\bold{y}", (0.2, 3), true, true, 0, 0) → labely
  34. FitLineY(linCoScatter) → flin
  35. Polygon({(0.05, 0.05), (2.95, 0.05), (2.95, 2.95), (0.05, 2.95)}) → q1
  36. KeepIf(0.1 ≤ y(PP) ≤ 2.9, PP, Zip[(ii, (1.5 * sin((1000 * ii))) + 1.5 + ee), ii, randomList2, ee, randomErrors]) → noCorScatter2
  37. Mirror(noCorScatter2, y = 1.5) → noCorScatter
  38. FitSin(nonlinScatter) → fitsin
  39. FitPoly(nonlinScatter, If[nonLinop ≤ 2, 2, 3]) → fitquad
  40. Text(Element[Options, 4], (0, 0), true, true) → text4
  41. Text(Element[Options, 3], (0, 0), true, true) → text3
  42. Text(Element[Options, 2], (0, 0), true, true) → text2
  43. Text(Element[Options, 1], (0, 0), true, true) → text1
  44. Translate(p, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)]) → p'

AI 绘图提示语参考

在坐标平面上生成三类散点分布,用同一组坐标轴与标题标签帮助判断相关性:其一为线性正相关,点围绕一条向上趋势的直线;其二为线性负相关(同样是直线趋势但斜率为负),用另一组散点表示;其三为非线性散点,点呈弯曲趋势(可用正弦或二次多项式的平滑曲线拟合并展示)。在图中加入两条坐标轴标注为 x 与 y,并在角落放置选项文字:POSITIVE LINEAR RELATION、NEGATIVE LINEAR RELATION、NONLINEAR RELATION、NO CORRELATION,用文字定位强调对比判断。散点范围限定在大致 0.1 到 2.9 的方框内,叠加误差让点有离散感。
以上提示语为根据原始绘图命令整理而来,仅供参考。