Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pylab as plt
- import numpy as np
- from matplotlib.ticker import LogLocator
- plt.rc('text', usetex=True)
- f,ax=plt.subplots(figsize=(10,8))
- plt.xscale('log')
- plt.yscale('log')
- plt.ylim([1e26,1e29])
- plt.xlim([20,1e10])
- plt.xlabel(r'x',fontsize=22)
- plt.ylabel(r'y',fontsize=22)
- plt.tick_params(axis='both', which='major', labelsize=22,length=9,direction='in')
- plt.tick_params(axis='both', which='minor', labelsize=22,length=5,direction='in')
- ax.yaxis.set_tick_params(right='on',which='both')
- ax.xaxis.set_tick_params(top='on',which='both')
- # manipulate x-axis ticks and labels
- ax.xaxis.set_major_locator(LogLocator(numticks=15)) #(1)
- ax.xaxis.set_minor_locator(LogLocator(numticks=15,subs=np.arange(2,10))) #(2)
- for label in ax.xaxis.get_ticklabels()[::2]:
- label.set_visible(False) #(3)
- plt.savefig('example.pdf',bbox_inches='tight')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement