使用数据集构建直方图

使用数据集构建直方图
几何画板及绘图内容加载中,请稍等……
2022-11-14 06:29
本交互式活动演示如何使用数据集构建直方图。涉及的核心数学概念是概率统计中的直方图绘制方法。作图要点包括使用 GeoGebra 命令 Shuffle(随机排序)、If(条件判断)、Take(取值)、CountIf(计数)、Sum(求和)、Zip(组合)、Element(元素)、twoPointBox(两点框选)、Polygon(多边形)、Mod(取模)、VerticalText(垂直文本)、Sequence(序列)、Segment(线段)、onboardingTextOffset(引导文本偏移)等。适合 6-8 年级学生学习如何组织和比较一组信息在直方图和条形图中的表示。

GeoGebra 命令及参数

  1. Shuffle(Sequence[15]) → randomList2, {12, 3, 1, 2, 10, 11, 6, 9, 5, 4, 15, 13, 8, 14, 7}
  2. Shuffle({1, 2, 3, 4}) → ansOrder, {4, 1, 3, 2}
  3. Shuffle(Sequence[1, 5]) → shuffleOrder, {5, 4, 1, 3, 2}
  4. Shuffle(Remove[Sequence[1, 49], {10, 20, 30, 40}]) → randomAges, {24, 42, 3, 14, 33, 16, 15, 27, 9, 25, 49, 23, 37, 45, 38, 4, 41, 32, 22, 44, 28, 6, 34, 13, 17, 12, 39, 36, 48, 46, 35, 29, 7, 8, 43, 21, 18, 1, 26, 5, 19, 31, 47, 2, 11}
  5. If((2 * countQuestion) + 9 < 45, (2 * countQuestion) + 1, 1) → startIndex
  6. Take(randomAges, startIndex, startIndex + 7) → ages
  7. CountIf(40 < A < 50, A, ages) → ans5
  8. CountIf(30 < A < 40, A, ages) → ans4
  9. CountIf(20 < A < 30, A, ages) → ans3
  10. CountIf(A < 10, A, ages) → ans1
  11. CountIf(10 < A < 20, A, ages) → ans2
  12. Sum(Zip[(("" * A) * B), A, Sort[ages], B, {", ", ", ", ", ", ", ", ", ", ",\\", ", ", ""}]) → textAgesSorted
  13. Zip(If[A ≟ 0, "no one", If[A ≟ 1, "one person", (("" * A) * " people")]], A, {ans1, ans2, ans3, ans4, ans5}) → counts
  14. Element(randomList2, Mod[countQuestion, 15] + 1) → randomNum2
  15. twoPointBox(Bar1a, Bar1b) → bar1
  16. twoPointBox(Bar2a, Bar2b) → bar2
  17. twoPointBox(Bar3a, Bar3b) → bar3
  18. twoPointBox(Bar4a, Bar4b) → bar4
  19. twoPointBox(Bar5a, Bar5b) → bar5
  20. Polygon({(-10, -1), (-10, 5.5), (55, 5.5), (55, -1)}) → viewbox
  21. Zip(twoPointBox[A, B], A, {Bar1a, Bar2a, Bar3a, Bar4a, Bar5a}, B, {Bar1b, Bar2b, Bar3b, Bar4b, Bar5b}) → barOutlines
  22. Mod(shuffleOrder(countQuestion + 1), 5) → ans3Temp
  23. VerticalText("Number of Campers") → labelY
  24. Sequence(Segment[(0, A), (55, A)], A, 1, 5) → horizGrids
  25. Sum(Zip[("" * (A * B)), A, ages, B, {}]) → agesLatex
  26. Sum(Zip[((("" * A) * B) * " "), A, ages, B, {",", ",", ",", ",", ",", ",", ",", ""}]) → agesText
  27. Zip(A + SolnAnchor, A, barPositions) → solnPositions
  28. Zip(SolnAnchor + (A, B), A, {0, 10, 20, 30, 40}, B, {ans1, ans2, ans3, ans4, ans5}) → solnPoints
  29. Zip(twoPointBox[A, A + (10, 0)], A, solnPoints) → solnOutlines
  30. Zip(Text[("" * A), SolnAnchor + (0, A), true, true, -1, 0], A, {1, 2, 3, 4, 5}) → solnNumbersY
  31. Sequence(Segment[SolnAnchor + (-1, i), SolnAnchor + (0, i)], i, 1, 5) → solnTicksY
  32. Sequence(Segment[SolnAnchor + (i, -0.1), SolnAnchor + (i, 0)], i, 10, 50, 10) → solnTicksX
  33. Sequence(Text[("" * A), SolnAnchor + (A, 0), true, true, 0, -1], A, 0, 50, 10) → solnNumbersX
  34. twoPointBox(solnPoints(1), solnPoints(1) + (10, 0)) → soln1
  35. twoPointBox(solnPoints(2), solnPoints(2) + (10, 0)) → soln2
  36. twoPointBox(solnPoints(3), solnPoints(3) + (10, 0)) → soln3
  37. twoPointBox(solnPoints(4), solnPoints(4) + (10, 0)) → soln4
  38. twoPointBox(solnPoints(5), solnPoints(5) + (10, 0)) → soln5
  39. VerticalText("\text{Number of Campers\\\vspace{245px}\\Number of Campers}") → lblSolnY
  40. Sequence(Segment[SolnAnchor + (0, A), SolnAnchor + (55, A)], A, 1, 5) → solnGrids
  41. If(showsolution, 200, 140) → maxX
  42. If(showsolution, -20, -15) → minX
  43. Sequence(Text[("" * A), (0, 0) + (A, 0), true, true, 0, -1], A, 0, 50, 10) → questionNumbersX
  44. Zip(Text[("" * A), (0, 0) + (0, A), true, true, -1, 0], A, {1, 2, 3, 4, 5}) → questionNumbersY
  45. Segment(Bar1a, Bar1a) → startBar1
  46. onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5]) → OnboardingTextOffset
  47. twoPointBox(Bar2a, Bar2b) → pulsingQuad
  48. Segment(Bar1a, Bar1b) → StartMarker1
  49. Segment(Bar2a, Bar2b) → StartMarker2
  50. Segment(Bar3a, Bar3b) → StartMarker3
  51. Segment(Bar4a, Bar4b) → StartMarker4
  52. Segment(Bar5a, Bar5b) → StartMarker5

AI 绘图提示语参考

绘制一个直方图,表示一组年龄数据的分布情况。首先,将年龄数据随机打乱并分组,然后根据年龄范围(0-9,10-19,20-29,30-39,40-49)统计每个年龄段的人数。接着,使用这些数据在直角坐标系中绘制直方图,横轴表示年龄范围,纵轴表示人数。每个直方图条形的高度对应于相应年龄段的人数,条形之间不留空隙。最后,添加Y轴标签和X轴标签,以及X轴和Y轴的刻度线。
以上提示语为根据原始绘图命令整理而来,仅供参考。