Task

Plot a function represented as     x,  y     numerical arrays.

Post the resulting image for the following input arrays (taken from Python's Example section on Time a function):

      x = {0,   1,    2,    3,    4,    5,     6,     7,     8,     9};
      y = {2.7, 2.8, 31.4, 38.1, 58.0, 76.2, 100.5, 130.0, 149.3, 180.0};

This task is intended as a subtask for Measure relative performance of sorting algorithms implementations.




Dim As Integer i, x(9), y(9)
For i = 0 To 9
    x(i) = i
Next i
 
y(0) = 2.7
y(1) = 2.8
y(2) = 31.4
y(3) = 38.1
y(4) = 58.0
y(5) = 76.2
y(6) = 100.5
y(7) = 130.0
y(8) = 149.3
y(9) = 180.0
 
Locate 22, 4
For i = 0 To 9
    Locate 22, ((i * 4) + 2) : Print i
Next i
 
For i = 0 To 20 Step 2
    Locate (21 - i), 0 : Print (i * 10)
Next i
 
Color 14
For i = 0 To 9
    Locate (21 - (y(i)/ 10)), (x(i) * 4) + 2 : Print "."
Next i
Sleep