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 x(9), y(9)
      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
 
      ORIGIN 100,100
      VDU 23,23,2;0;0;0;
      VDU 5
 
      FOR x = 1 TO 9
        GCOL 7 : LINE 100*x,720,100*x,0
        GCOL 0 : PLOT 0,-10,-4 : PRINT ; x ;
      NEXT
 
      FOR y = 20 TO 180 STEP 20
        GCOL 7 : LINE 900,4*y,0,4*y
        GCOL 0 : PLOT 0,-212,20 : PRINT y ;
      NEXT
 
      LINE 0,0,0,720
      LINE 0,0,900,0
 
      GCOL 4
      FOR i% = 0 TO 9
        IF i%=0 THEN
          MOVE 100*x(i%),4*y(i%)
        ELSE
          DRAW 100*x(i%),4*y(i%)
        ENDIF
      NEXT