For my thesis I have to plot graphs for pretty big value range ( from 10^-6 to 10^14). I want to have all the gridlines but only some tick labels.
all the gridlines
but only some tick labels
Example I’ve made to make testing easier:
import numpy as np
from matplotlib import pyplot as plt
start=1e-6
stop= 1e14
I_out_tab = []
x=np.power(np.divide(stop, start), np.divide(1, 1000))
for i in range(0,1000):
I_out_tab.append(start * np.power(x,i))
y=[]
for i in I_out_tab:
y.append( 2 * i**3)
plt.loglog(I_out_tab, y)
plt.grid(True, which="both", ls="-")
plt.gca().xaxis.set_major_locator(plt.LogLocator(base=10, subs='all', numticks=100))
plt.show()
Any ideas?
New contributor
Michał Rękawek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.