This diagram is from Andrew Ng course for ML/DL:
But isn't the cost function (least squares function) shape depends on scatter of the data ?
For example below, the minimum will be at (0,1):
that doesn't correspond to convex shape (if you will imagine it in 3d plot), that Andrew Ng showed above.
UPDATE
Oh, i think I understand... my example is a convex shape too, but simply shifted by coordinates, relatively to the Andrew's example.
Am i right?


Because the cost function is given by:
$$ \frac{1}{2} \left\| X \theta - y \right\|_{2}^{2} $$
Which is a Linear Regression Problem with the Least Squares cost function which is a Convex Function of $ \theta $.