python - Set tick width when using axes_grid matplotlib -


i trying make shared y-axes plot (3 plots in row). following approaches did not work when tried set tick widths 3 subplots.

first tried set tick width via rc params. works tick lengths not width. following error message:

keyerror: 'xtick.major.width not valid rc parameter.see rcparams.keys() list of valid parameters.' 

when looking list xtick.major.width valid parameter else wrong?

here code

import matplotlib.pyplot plt import matplotlib mpl import scipy.io mpl_toolkits.axes_grid1 import grid import numpy np pylab import *   # set tick width mpl.rcparams['xtick.major.size'] = 10 mpl.rcparams['ytick.major.size'] = 10 mpl.rcparams['xtick.major.width'] = 2  #ignore data import please x = scipy.io.loadmat('ud04.mat') psi11_final=x['psi11_final'] psi12_final=x['psi12_final'] psi21_final=x['psi21_final'] psi22_final=x['psi22_final'] psi11_final=flipud(psi11_final) psi12_final=flipud(psi12_final) psi21_final=flipud(psi21_final) psi22_final=flipud(psi22_final)  na11_final=x['na11_final'] na12_final=x['na12_final'] na21_final=x['na21_final'] na22_final=x['na22_final'] na11_final=flipud(na11_final) na12_final=flipud(na12_final) na21_final=flipud(na21_final) na22_final=flipud(na22_final)  np11_final=x['np11_final'] np12_final=x['np12_final'] np21_final=x['np21_final'] np22_final=x['np22_final'] np11_final=flipud(np11_final) np12_final=flipud(np12_final) np21_final=flipud(np21_final) np22_final=flipud(np22_final)  extot=na11_final+na12_final+na21_final+na22_final+np11_final+np12_final+np21_final+np22_final   k_bar=x['k_bar'] nkap_bar=x['nkap_bar'] nkap_bar=nkap_bar[0,0] kapmin=k_bar[0,0] kapmax=k_bar[0,nkap_bar-1]  mu_bar=x['mu_bar'] nmu_bar=x['nmu_bar'] nmu_bar=nmu_bar[0,0] mumin=mu_bar[0,0] mumax=mu_bar[0,nmu_bar-1]  fig = plt.figure(1, (12., 4.)) grid = grid(fig, 111, # similar subplot(111)                 nrows_ncols = (1,3), # creates 3x1 grid of axes                 axes_pad=0.1) # pad between axes in inch.  in range(3):     #grid[i].imshow(extot,interpolation='nearest')     grid[i].imshow(extot,aspect='auto',extent=(kapmin,kapmax,mumin,mumax),interpolation='nearest') plt.show() 

then tried set tick width making following change in last lines of code , getting rid of rc parameter stuff @ beginning:

ax = plt.gca() ax.tick_params(axis='both',width=5) in range(3):     #grid[i].imshow(extot,interpolation='nearest')     grid[i].imshow(extot,aspect='auto',extent=(kapmin,kapmax,mumin,mumax),interpolation='nearest') plt.show() 

this changed tick thickness of last plot in 3*1 series. there way access of them without using rc params? helpful rid of appearing overlap of tick labels. there tried set ticks manually with

#plt.xticks([0.02,0.04,0.06], [0.02,0.04,0.06]) #plt.yticks([-0.3,-1.2,-1.1,-1.0], [-0.3,-1.2,-1.1,-1.0]) 

but again changed appearence in last of 3 plots on grid.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -