From 4dcd3868a7489ec3dbd08dae9a7802251751ab9b Mon Sep 17 00:00:00 2001 From: jwberent Date: Mon, 6 Oct 2025 15:25:20 -0400 Subject: [PATCH] I built the scatterplot by making the axes and plotting the points. Checkpoint 3: This lab went alright. I got through most of it easy but got stuck on plotting the points. I understand where most of the parts come together. The thinking in checkpoint 1 was used when creating the graph in checkpoint 3. I have no ideas for other programs I could write. --- scatterplot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scatterplot.py b/scatterplot.py index 7681e6d..af92c4b 100644 --- a/scatterplot.py +++ b/scatterplot.py @@ -58,9 +58,10 @@ def draw_points(data, color, size): y_values = get_y_values(data) xmin, xmax = bounds(x_values) ymin, ymax = bounds(y_values) - scaled_x = scale(x_values,xmin,xmax,ymin,ymax) - scaled_y = scale(y_values,xmin,xmax,ymin,ymax) - draw_point(scaled_x, scaled_y, color, size) + for x,y in data: + scaled_x = scale(x,xmin,xmax,14,492) + scaled_y = scale(y,ymin,ymax,-927,3710) + draw_point(scaled_x, scaled_y, color, size) with no_delay():