To understand what every plotting library does internally, draw a scatter plot as text.
Input: first line W H (grid width and height in characters), then a CSV with columns x,y.
- Map each point with linear scales: column = ⌊(x − xmin)/(xmax − xmin) × (W − 1) + 0.5⌋, row = ⌊(y − ymin)/(ymax − ymin) × (H − 1) + 0.5⌋ (round half up; if max = min the index is 0). Row 0 is the bottom.
- A cell with one point shows
*, with 2–9 points the count, with more9; empty cells are spaces. - Print each row from top to bottom as
|followed by the cells, without trailing spaces; then+followed by W dashes; thenx: [4, 14] y: [3.1, 9.26] points: 11(values in Python's:gformat).