创建散点图

创建散点图
几何画板及绘图内容加载中,请稍等……
2023-01-27 12:51
本范例通过识别坐标轴和绘制点来创建散点图。涉及的核心数学概念是统计学中的数据组织、展示和解释,以及如何通过散点图确定正相关、负相关或无相关关系。作图要点包括使用 GeoGebra 命令如 RandomUniform、Take、PixelsToPoint、Zip、Unique、Length、If、Sort、Flatten、Point、KeepIf、Polygon、Corner、Segment、Distance、Join、Sum、Sequence、VerticalText、Translate、RemoveUndefined、makeBox、PartitionPoint、Remove、Intersection、expandCircle;对象如 allRandoms、numRandoms、countQuestion、randIndex、currentRandomSeeds、randomProb、dimensionsAll、dimensions、pixelHeightConvert、boxHeight、pixelWidthConvert、rowWidth、CornerLeftTable、randomMult、randomRecip、randomXH、randomSlope1、randomSlope2、problem3x、problem3y、randomPoints3、randomPoints3U、lengthUnique3、uniqueRandomPoints3、titleHeight、rowHeight、numMax、randomSlope、guideLine、problemPoints12、problemPoints12Rounded、problemPoints12U、lengthUnique12、uniqueRandomPoints12、randomPoints、randomPointsRounded、scalingFactor、DragPoints、InputPoint1、InputPoint6。适合 6-8 年级学生学习数据分析。

GeoGebra 命令及参数

  1. RandomUniform(0, 0.99, 400) → allRandoms, {0.4364967330707387, 0.8279794215391527, 0.4290004671891307, 0.06717012330957603, 0.8605279110658038, 0.3970423519998629, 0.7571751439757286, 0.3402434657518975, 0.5503796826218706, 0.22096660340787075, 0.4257581327249671, 0.3625300130213526, 0.6827924728731817, 0.40847179172775583, 0.3682300626589904, 0.19951292232032217, 0.47876048244123615, 0.8653074219773348, 0.266844854026304, 0.8059439764226863, 0.4444092525206932, 0.17363905755533662, 0.12234263903809962, 0.2916382486048643, 0.3997060167471245, 0.6759072554351157, 0.7735712797312612, 0.3233571984564109, 0.012247582505562382, 0.15993252142081008, 0.09806461414824516, 0.1364428196238672, 0.768086812559315, 0.7623036511773474, 0.32731125196725924, 0.29684855186737946, 0.2997136410545501, 0.128287304338225, 0.5015708368754435, 0.3871322861105321, 0.37289792029101787, 0.938636003778352, 0.01865525456168939, 0.7088340978597069, 0.799130849375167, 0.4867473342307885, 0.359090041427768, 0.9784565774944668, 0.2988686633985176, 0.05364147119569441, 0.0065073168835029106, 0.12499797411674321, 0.6226863228120381, 0.45317442586803086, 0.6469939003593178, 0.0836578181418435, 0.1527909338125303, 0.5257942473870935, 0.7344296563417425, 0.9429430363807179, 0.4261236076820623, 0.45597212989362274, 0.8805984831193984, 0.38094650276689346, 0.8824960086063224, 0.8762056525030856, 0.12904001010180927, 0.7910531219039421, 0.8568608623431296, 0.609191157481104, 0.21023361098518367, 0.6677480593332656, 0.05390918844479141, 0.8894017974042014, 0.9227662562167037, 0.7095593673531793, 0.3457144266031207, 0.21588373667235997, 0.4606340391963146, 0.6084619904604097, 0.34911221114132884, 0.7195963500512254, 0.9107630313235662, 0.603302737145989, 0.25890744697311335, 0.5310740831159212, 0.8772075219612891, 0.11897568477313389, 0.8158429842771355, 0.25757555144926175, 0.5792949967352798, 0.223184744860093, 0.9245432289567547, 0.3932122011144987, 0.3302345394026996, 0.8786753178678169, 0.046362494320836486, 0.3708124407364203, 0.42039152646213235, 0.4207990178915782, 0.015222991255795787, 0.3204779542883649, 0.2055540561362185, 0.8781958236923035, 0.12111826655334555, 0.9469278575341059, 0.09507732884788021, 0.6582351643016762, 0.06598770045982304, 0.22580296843950753, 0.4677902749522571, 0.8786521421067923, 0.4001345356548934, 0.8181149082349596, 0.9649839745092323, 0.8825480567206452, 0.4742637274848575, 0.9019774018121367, 0.439674983953517, 0.3255940258418153, 0.19255831685729963, 0.9316446339951537, 0.8896466726133728, 0.2818837193337276, 0.06599186418343446, 0.8657085183681175, 0.24852005493324497, 0.10842654623594017, 0.8722913973729814, 0.499069633491764, 0.1342912460543183, 0.5377548811851846, 0.9196197290577507, 0.19699871148711437, 0.1283950822793751, 0.1035385293367738, 0.2351378141835929, 0.854243075792854, 0.8504159942382448, 0.6454578760223926, 0.4271367538229782, 0.48770980306890005, 0.9540644177703039, 0.4768809511067771, 0.8503965059764235, 0.3177700998114613, 0.6589728408329684, 0.3221231626760005, 0.3988318756413017, 0.16068097778069504, 0.7202388192057985, 0.12923763395858792, 0.947328904465468, 0.2430090873236472, 0.9134527871150823, 0.5593917584123383, 0.8859533996885486, 0.5082674208374608, 0.7371959313584099, 0.7649305167718347, 0.9744309242269786, 0.09623957736347798, 0.967680267423952, 0.025209689604359688, 0.10295078069415323, 0.42666707069053733, 0.9113244705133795, 0.5622013906755716, 0.8069394924662249, 0.26111443436837306, 0.5106209626633605, 0.12673273002908136, 0.29847791350959507, 0.6399023263542263, 0.3566468990401646, 0.2810124833894419, 0.44550271641760797, 0.8150131485288095, 0.5980078232575767, 0.1138334647531287, 0.8618379542608194, 0.8348243051475825, 0.030875144092359204, 0.34150821959611244, 0.46644382241878146, 0.6124135635446006, 0.19809014516955306, 0.4802030015468769, 0.7890487826949212, 0.10600639469204262, 0.37705403623801254, 0.32387991317172815, 0.7115485323186809, 0.26789934543015304, 0.16631019222541074, 0.4965394931820658, 0.21020937068706727, 0.46689473182252805, 0.06934725077543924, 0.7078761244310436, 0.902805118755068, 0.008920067134655898, 0.08121208295964552, 0.707815667160107, 0.8273463961762543, 0.5610824776459197, 0.229020420160451, 0.9777003423250079, 0.1850275056885949, 0.44592151028652277, 0.35138766388353093, 0.6841173565762422, 0.4094209028031698, 0.6150752042333292, 0.9041760011460814, 0.3455385993541891, 0.7667904713271244, 0.6949629186826198, 0.47076416852797637, 0.382045619598733, 0.4986746764421157, 0.32141446133408175, 0.6142946757018587, 0.6644590110591793, 0.2876070911689947, 0.41543881220767537, 0.38703812600069654, 0.8511742568663745, 0.19999611677203935, 0.2985270229997045, 0.10813809797201424, 0.45892529464575765, 0.35677788398307675, 0.6930222802062745, 0.31556029628072696, 0.26755505612089303, 0.6524850169160122, 0.20116660959107005, 0.8410672868948211, 0.9286668560680099, 0.5468413190094514, 0.9254470015651682, 0.5184765311785545, 0.3337630233180818, 0.4798963169611203, 0.6628154301594161, 0.8053318086658168, 0.4791471682038173, 0.8320555823869676, 0.006245183443067861, 0.8364287997314388, 0.7124736566194705, 0.3841422222598797, 0.658912908632152, 0.49438407079532665, 0.11937305157413688, 0.0698410914417884, 0.44905874704247967, 0.007621505620509098, 0.9880645741409039, 0.6435325531711233, 0.9372785183579095, 0.34977383506267107, 0.7352866023687109, 0.15061345568916631, 0.4826406351895304, 0.0065575640375341495, 0.1982335297316016, 0.2749328572868937, 0.649595992552774, 0.986676939194105, 0.2244824308621502, 0.9389367346102212, 0.97416379877466, 0.09224893039953619, 0.06512520879689718, 0.9265200844186129, 0.3053262113819715, 0.9116138140117354, 0.7054919918634037, 0.0864265804148374, 0.825954670435458, 0.15320640976680974, 0.4829587868057046, 0.005315584047385152, 0.6569157307998795, 0.5534116899914913, 0.6223774563763911, 0.16433276917694023, 0.278268734167044, 0.5140130926870023, 0.8166485466069383, 0.36117484933188654, 0.24266849729310286, 0.8859656890454323, 0.2728771495252764, 0.07123120275028015, 0.1182249328565949, 0.4657866520049325, 0.02340979535855264, 0.7364139075241214, 0.5011474997433185, 0.018853219167775936, 0.03584489328103907, 0.38875472995341226, 0.8825164707948957, 0.01033463245463146, 0.7368420895265098, 0.7377521128098633, 0.888473777161356, 0.2893564768279657, 0.5212253011710458, 0.1357926112693821, 0.44901498181983723, 0.6453077536671146, 0.920482163654913, 0.8747507914834963, 0.337390175227722, 0.026947703408484017, 0.2533072381150066, 0.23908833697647125, 0.5398853619821156, 0.27515591161598063, 0.5053185787406886, 0.2364274880980048, 0.8544565401596377, 0.8387919636903511, 0.6054977949880848, 0.5756653795450455, 0.23632830377273395, 0.3501912721679857, 0.18326039002508165, 0.565225771448983, 0.38924391248951223, 0.13232199679504703, 0.23235871813977751, 0.4600107598665775, 0.3925680594608787, 0.02356356219695379, 0.46605196067646953, 0.9850198843407029, 0.9668949329762323, 0.2184399149618699, 0.1021476065889638, 0.8164457794915703, 0.5142020501455065, 0.8734518855434965, 0.45662616954423696, 0.5573341738648881, 0.9029173520113872, 0.24640039645844014, 0.8806061342949506, 0.584614086109369, 0.6035301209839816, 0.44527807338993425, 0.9773881025778408, 0.3474569328157455, 0.5565780243915278, 0.8289301996358889, 0.404237366814447, 0.9435162547968685, 0.9219803026115709, 0.6362458004439163, 0.11742148346688354, 0.889628345561435, 0.8367647307591398, 0.9736383862638203, 0.21881430435102503, 0.49702098588442917, 0.7872481489837272, 0.7620107936713495, 0.19811010274604457, 0.09798225013235289, 0.6516825953692253, 0.8442722803106075, 0.7063621556954107, 0.45128228636787915, 0.7402672418863757, 0.8327860920573655, 0.8541662575102189, 0.8774212992052866, 0.7312526701424906, 0.36287364619308266, 0.21135608413119955, 0.45199261032164534, 0.7846276594313675, 0.22368780952920805, 0.6945584388554892, 0.3161052833763385, 0.7085797718332465, 0.7413897954899655, 0.9543770109411612, 0.6469013031136648, 0.5185598438847401, 0.9316253816479942, 0.5553307438839921, 0.8987324133078476, 0.3543565448109667, 0.43879432004925983, 0.018967357734152215}
  2. Take(allRandoms, randIndex, randIndex + numRandoms - 1) → currentRandomSeeds
  3. PixelsToPoint(Corner[1], Corner[3], Corner[5], (11 + 5, 154)) → CornerLeftTable
  4. Zip((-100 + floor((n * 201))) / 10, n, Take[currentRandomSeeds, 15, 39]) → randomMult
  5. Zip(10 + floor((n * 11)), n, Take[currentRandomSeeds, 8, 32]) → randomRecip
  6. Zip(floor((n * 61)) / 10, n, First[currentRandomSeeds, 24]) → randomXH
  7. Zip(1 + floor((n * 6)), n, First[currentRandomSeeds, 24]) → problem3x
  8. Zip((round((20 + floor((n * 80))) / 5) * 5), n, Take[currentRandomSeeds, 15, 39]) → problem3y
  9. Unique(randomPoints3) → randomPoints3U
  10. Length(randomPoints3U) → lengthUnique3
  11. If(6 < Mod[(6 * (countQuestion + 1)), lengthUnique3] < lengthUnique3, Take[randomPoints3U, Mod[(6 * countQuestion), lengthUnique3] + 1, Mod[(6 * (countQuestion + 1)), lengthUnique3]], Mod[(6 * (countQuestion + 1)), lengthUnique3] ≟ 0, Last[randomPoints3U, 6], Join[{Last[randomPoints3U, 6 - Mod[(6 * (countQuestion + 1)), lengthUnique3]], First[randomPoints3U, Mod[(6 * (countQuestion + 1)), lengthUnique3]]}]) → uniqueRandomPoints3
  12. If(randomProb ≠ 2, ((42 + 2) * pixelHeightConvert), ((55 + 2) * pixelHeightConvert)) → titleHeight
  13. If(randomProb ≟ 2, 20, 100) → numMax
  14. If(randomProb ≟ 1, randomSlope1, randomProb ≟ 2, randomSlope2, 0) → randomSlope
  15. Zip((n, guideLine(n) + c / k), n, randomXH, c, randomMult, k, randomRecip) → problemPoints12
  16. Zip((round(x(n)), (round((y(n) * If[randomProb ≟ 2, 1, 0.2])) * If[randomProb ≟ 2, 1, 5])), n, problemPoints12) → problemPoints12Rounded
  17. Unique(KeepIf[y(n) < numMax, n, problemPoints12Rounded]) → problemPoints12U
  18. Length(problemPoints12U) → lengthUnique12
  19. If(6 < Mod[(6 * (countQuestion + 1)), lengthUnique12] < lengthUnique12, Take[problemPoints12U, Mod[(6 * countQuestion), lengthUnique12] + 1, Mod[(6 * (countQuestion + 1)), lengthUnique12]], Mod[(6 * (countQuestion + 1)), lengthUnique12] ≟ 0, Last[problemPoints12U, 6], Join[{Last[problemPoints12U, 6 - Mod[(6 * (countQuestion + 1)), lengthUnique12]], First[problemPoints12U, Mod[(6 * (countQuestion + 1)), lengthUnique12]]}]) → uniqueRandomPoints12
  20. If(randomProb ≟ 3, uniqueRandomPoints3, uniqueRandomPoints12) → randomPoints
  21. Sort(Zip[(round(x(n)), If[y(n) < 0, 0, y(n)]), n, randomPoints]) → randomPointsRounded
  22. If(randomProb ≟ 2, 0.2, 1) → scalingFactor
  23. Flatten(Sequence[Sequence[(n / 2, ((5 * m) * scalingFactor)), n, -6, 12], m, 0, 20]) → DragPoints
  24. Point(DragPoints) → InputPoint1
  25. Point(DragPoints) → InputPoint6
  26. Point(DragPoints) → InputPoint5
  27. Point(DragPoints) → InputPoint4
  28. Point(DragPoints) → InputPoint3
  29. Point(DragPoints) → InputPoint2
  30. Zip((x(n), y(n)), n, answerInput1) → answerInput
  31. KeepIf(¬(n ∈ answerInput), n, randomPointsRounded) → errorList
  32. Polygon({(-2.5, (105 * scalingFactor)), (-2.5, (-1 * scalingFactor)), (6.5, (-1 * scalingFactor)), (6.5, (105 * scalingFactor))}) → DragArea
  33. Sort(answerInput) → answerInputSorted
  34. Zip(n ∈ randomPointsRounded, n, answerInput) → boolCorrects
  35. Zip(abs(y(m) - y(n)), m, answerInputSorted, n, randomPointsRounded) → solutionYDifferences
  36. Zip(abs(x(m) - x(n)), m, answerInputSorted, n, randomPointsRounded) → solutionXDifferences
  37. Zip(n ≟ 0 ∧ m ≤ (2 * scalingFactor), n, solutionXDifferences, m, solutionYDifferences) → boolCorrectPoints
  38. Polygon(graphDimPoints) → graphArea
  39. Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], A], A, {(pixelsLeft, pixelsTop), (pixelsLeft, y(Corner[5]) - pixelsBottom), Corner[5] - (pixelsRight, pixelsBottom), (x(Corner[5]) - pixelsRight, pixelsTop)}]) → borderBox
  40. Corner(5) → layoutAppSize
  41. Segment((0, 0), (graphDims(3), 0)) → axisX
  42. Segment((0, 0), (0, graphDims(4))) → axisY
  43. If(countQuestion ≟ 0, 1, 1 + floor((currentRandomSeeds(1) * 2))) → randomOrder
  44. Distance(Corner[sizeLabelX, 1], Corner[sizeLabelX, 2]) → numLabelXW
  45. Distance(Corner[sizeLabelY, 1], Corner[sizeLabelY, 2]) → numLabelYW
  46. Join({{tableLabel(1) + "&" + (tableLabel(2)) + "\vphantom{\frac{a}{b}}\\\hline"}, Sequence["" + (x(randomPointsRounded(n))) + "&" + (y(randomPointsRounded(n))) + "\vphantom{\large{|}}\\\hline", n, 1, 6]}) → textListForTable
  47. Sum(textListForTable) → textForTable
  48. Polygon(Sequence[Corner[textLabelX, n], n, 1, 4]) → boxAxisXLabel
  49. Polygon(Sequence[Corner[textLabelY, n], n, 1, 4]) → boxAxisYLabel
  50. Polygon(polygonCoords) → dragArea
  51. Corner(sizingText, 4) → CornerSizing
  52. Sequence(Corner[textLabelX, n], n, 1, 4) → xLabelCorners
  53. Sequence(Corner[textLabelY, n], n, 1, 4) → yLabelCorners
  54. VerticalText(textLabelY) → vertLabelY
  55. VerticalText(textLabelY) → sizeLabelYVert
  56. Distance(Corner[sizeLabelYVert, 1], Corner[sizeLabelYVert, 4]) → numVertYH
  57. Translate(PolygonCoordsStart, Vector[(2 * Vector[CornerSizing, PolygonCoordsStart])]) → StartInputPoint
  58. RemoveUndefined(Sequence[If[boolCorrectPoints(n), answerInputSorted(n)], n, 1, 6]) → correctPoints
  59. makeBox(CornerLeftTable, rowWidth, boxHeight) → hintBox
  60. If(animationSlider < 0.3, 0, animationSlider - 0.3) → animationSlider1
  61. PartitionPoint(HintPoint1, HintPoint3, animationSlider1, 1) → HintAnimate1
  62. PartitionPoint(HintPoint2, HintPoint3, animationSlider1, 1) → HintAnimate2
  63. Segment(HintPoint2, HintAnimate2 - (0.15, 0)) → hintSeg2
  64. Segment(HintPoint1, HintAnimate1 - (0, (2.4 * scalingFactor))) → hintSeg1
  65. Translate(hintBox, Vector[(0, ((-numFirstIncorrect) * rowHeight) - titleHeight)]) → hintBoxFirst
  66. Translate(hintBox, Vector[(0, ((-numFirstIncorrect) * rowHeight) - titleHeight)]) → hintBoxOutline
  67. Remove(answerInput, randomPointsRounded) → errorListInput
  68. Intersection(answerInput, randomPointsRounded) → solutionList
  69. Zip(PartitionPoint[n, m, animationSlider2, 1], n, Sort[errorListInput], m, Sort[errorList]) → solutionAnimation
  70. Sum({tableLabel(1) + "&" + (tableLabel(2)) + "\vphantom{\frac{a}{b}}\\\hline"}) → textForTitle
  71. Sum({"" + (x(randomPointsRounded(1))) + "&" + (y(randomPointsRounded(1))) + "\vphantom{\large{|}}\\\hline"}) → textForRow
  72. expandCircle(InputPoint1, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5]) → pulsingObject

AI 绘图提示语参考

画一个散点图,包含一组随机分布的点,X轴和Y轴作为坐标轴,表格中列出每个点的坐标值,整体布局清晰,适合数据分析展示。
以上提示语为根据原始绘图命令整理而来,仅供参考。