For example, after I set xlim, the ylim is wider than the range of data points shown on the screen. Of course, I can manually pick a range and set it, but I would prefer if it is done automatically.

Or, at least, how can we determine y-range of data points shown on screen?

plot right after I set xlim:
![plot right after I set xlim](https://i.stack.imgur.com/CD1ak.png)

plot after I manually set ylim:
![plot after I manually set ylim](https://i.stack.imgur.com/vuypU.png)