matplotlib
automatically adds some small margin to plots so make them pretty:
import matplotlib.pyplot as plt
plt.plot([1,2,3],[2,3,4])
the actual xlim
is (0.9, 3.1)
(as returned by axes.get_xlim()
) instead of (1,3)
dictated by the data.
This is usually reasonable except for percent plots where the limits are (-80%,120%)
which makes for 40/140 wasted space.
How is this extra margin computed?
How can I affect it? (other than passing data max/min to set_xlimit
).