diff --git a/scatterplot.py b/scatterplot.py index acb666e..1f08a68 100644 --- a/scatterplot.py +++ b/scatterplot.py @@ -60,14 +60,18 @@ def draw_points(data, color, size): y_values = get_y_values(data) ymin, ymax = bounds(y_values) #Find the scaled x-position for the point. + listx = [] for x_value in x_values: scaled_x = scale(x_value, xmin, xmax, 0, constants.PLOT_WIDTH) + listx.append(scaled_x) #Find the scaled y-position for the point. + listy = [] for y_value in y_values: scaled_y = scale(y_value, ymin, ymax, 0, constants.PLOT_WIDTH) + listy.append(scaled_y) + #for something in somethings: + for scaled_x, scaled_y in zip(listx, listy): draw_point(scaled_x, scaled_y, color, size) -# scaled_x = scale(x_values, xmin, xmax, ymin, ymax) -# scaled_y = scale(y_values, xmin, xmax, ymin, ymax) #Use draw_point(scaled_x, scaled_y, color, size) to draw the point.