python - xticks ends placement of numbers on x-axis prematurely, i.e. the ticks do not reach the right end -


i have simple script graphs tpr/sp tradeoff.

it produces pdf (note placement of x-axis numbers): enter image description here

the relevant code likely:

xticks(range(len(sp_list)), [i/10.0 in range(len(sp_list))], size='small') 

the whole code is:

sn_list = [0.89451476793248941, 0.83544303797468356, 0.77215189873417722, 0.70042194092827004, 0.63291139240506333, 0.57805907172995785, 0.5527426160337553, 0.5527426160337553, 0.53586497890295359, 0.52742616033755274, 0.50632911392405067, 0.48101265822784811, 0.45569620253164556, 0.43459915611814348, 0.40084388185654007, 0.3628691983122363, 0.31223628691983124, 0.25738396624472576, 0.20253164556962025, 0.12658227848101267, 0.054852320675105488, 0.012658227848101266] sp_list = [0.24256292906178489, 0.24780976220275344, 0.25523012552301255, 0.25382262996941896, 0.25684931506849318, 0.36533333333333334, 0.4548611111111111, 0.51778656126482214, 0.54978354978354982, 0.59241706161137442, 0.63492063492063489, 0.80851063829787229, 0.81203007518796988, 0.85123966942148765, 0.88785046728971961, 0.91489361702127658, 0.9135802469135802, 0.9242424242424242, 0.94117647058823528, 0.967741935483871, 1.0, 1.0]  figure()  xlabel('score cutoff point')  ylabel('percent')  plot(sp_list)  plot(sn_list)  legend(('true positive rate', 'specificity'), 'upper left', prop={"size":9}, shadow=false, fancybox=false)  grid(false)  xticks(range(len(sp_list)), [i/10.0 in range(len(sp_list))], size='small')  savefig('sp_sn.png') 

you can call autoscale() after xticks(), set new axes' limits automatically.

enter image description here


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -