In the code that you have provided above, the variable 'ii' is undefined. It is a good practice to predefine the variable 'divider', Add the line provided below before the for loop begins.
In the last if condition: As per the code provided I can see that the variable 'divider' has only 0.25 as the value and this will plot only a straight line 0.25. Please provide more information on the output that you are expecting. Also please post a sample image of the output that you are expecting.