I've got a function that creates a log-log plot using Matplotlib.
import matplotlib.pyplot as plt
plt.loglog(xdata, ydata, label="function label...")
# ...more plots
plt.set_xlabel("Frequency (Hz)")
plt.show()
I'd like to have Matplotlib plot one y-axis tick step beyond the highest/lowest data points on the y-axis, so in the plot below I would like the y-axis limits to be set to (1e-9, 1e-6)
as the next lowest/highest log steps with the default base
of 10 (the arrows point towards these desired limits). While I can do this by computing the next lowest/highest step with the plotted data each time, and set the limits manually, I want to know if it's possible to set some option in e.g. LogLocator
or elsewhere to do this automatically, ideally in a way that is independent of the axis scaling (log or linear), or the current LogLocator
's base
.