histogram - How to remove the over x line in pylab (python)? -


how remove on line after banana histogram can stick vertical line?

import matplotlib matplotlib.use('svg') pylab import*  label = ['apple','orange', 'banana'] number = [5,4,3]  barwidth =0.5  bar_location= range(len(number))  bar(bar_location,number,width=barwidth) xlim(0-barwidth,len(number)) xticks([ + barwidth/2 in bar_location], label) tittle('fruits') xlabel('my_fruit') ylabel('number') savefig('fruits.svg') show() 

you can set range of x-axis xlim(), e.g.:

xlim(0 - barwidth, len(number) - 0.5) 

(but make sure insert before savfig()).


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -