lab_scatter/planning_scatter.md

1.2 KiB

Planning the scatter plot

  • Draw a scatter plot.
    • Draw the axes.
      • Draw the x-axis.

        • Draw the line.
        • Find the range of the x-values
        • Divide the range by 5
        • Start at the origin. Label it with the lowest x-value
        • repeat until at the end of the axis:
          • add 1/5 of the range to the x-value
          • move to the right 1/5 of the length of the axis
          • draw a tick mark and label with the next x-value
      • Draw the y-axis.

        • Draw the line.
        • Find the range of the y-values
        • Divide the range by 5
        • Start at the origin. Label it with the lowest y-value
        • repeat until at the end of the axis:
          • add 1/5 of the range to the y-value
          • move up 1/5 of the length of the axis
          • draw a tick mark and label with the next y-value
    • Plot the points.
      • Repeat for each point:
        • Start with turtle at the "origin"
        • move to the right the amount of the difference between the x-value and the lowest x- value
        • move up the amount of the difference between the y-value and the lowest y-value
        • plot the point
        • return to the "origin"