From c3279a0d8812e3c61ea70418f78ae6c3b5937085 Mon Sep 17 00:00:00 2001 From: mollychi Date: Mon, 6 Oct 2025 22:46:30 -0400 Subject: [PATCH] Not finished but submitting so professor emma can see --- scatterplot.py | 13 ++++++++++++- transform.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scatterplot.py b/scatterplot.py index 50f66fb..59e3fe9 100644 --- a/scatterplot.py +++ b/scatterplot.py @@ -34,7 +34,18 @@ def draw_scatterplot(data, size=5, color="black"): draw_points(data, color, size) def draw_axes(data): - "Draws the scatter plot's axes." + x_values = get_x_values(data) + y_values = get_y_values(data) + xmin, xmax = bounds(x_values) + ymin, ymax = bounds(y_values) + xticks = get_tick_values(xmin, xmax) + yticks = get_tick_values(ymin,ymax) + for tick in xticks: + screen_x_position = scale(tick, xmin, xmax, 0, constants.PLOT_WIDTH) + draw_x_tick(screeen_x_position, tick) + for tick in yticks: + screen_y_position=scale(tick, ymin, ymax, 0, constants.PLOT_WIDTH) + draw_y_tick(screen_x_position, tick) def draw_points(data, color, size): "Draws the scatter plot's points." diff --git a/transform.py b/transform.py index 5beb3ad..8656395 100644 --- a/transform.py +++ b/transform.py @@ -23,7 +23,7 @@ def minimum(data): def bounds(data): "Returns a list of the smallest and largest numbers in data" - return [minimum(data),maximum(data)] + return [minimum(data), maximum(data)] def clamp(value, low, high): """Clamps a value to a range from low to high.