So, this is how the explanation goes:
- plt.plot([1.5, 3.0]) plots a line graph connecting two points (0, 1.5) and (1.0, 3.0).
- The plot command expects two arguments (Python list, NumPy array or pandas DataFrame) for the x and y axis respectively.
- If only one argument is passed, it takes it as y axis co-ordinates and for x axis co-ordinates it takes the length of the argument provided.
- In this example, we are passing only one list of two points, which will be taken as y axis coordinates.
- For the x axis, it takes the default values in the range of 0 to 1, since the length of the list [1.5, 3.0] is 2.
- If we had three coordinates in the list for y, then for x, it would take the range of 0 to 2.
- You should see the graph like the ...