How to set axis limits in matplotlib - altcademy.com
https://www.altcademy.com/blog/how-to-set-axis-limits-in-matplotlib/
WebJan 20, 2024 · One of the simplest ways to set axis limits in Matplotlib is by using the set_xlim() and set_ylim() methods of the axes object. These methods allow you to define the range of values displayed on the x-axis and y-axis, respectively. Here's a basic example: import matplotlib.pyplot as plt. # Sample data. x = [0, 1, 2, 3, 4] y = [0, 1, 4, 9, 16]
DA: 31 PA: 70 MOZ Rank: 69