python - Star x-axes with 1 with matplotlib -


I am plotting a list with numbers like this:

  pdf = Pdfpages ('Test.pdf') pyplot.plot ([1,2,4,7,8], color = '# 3399ff') pyplot.ylabel ('level') pyplot.xlabel ('number of tasks' ) Pyplot.suptitle ('battery') pdf.savefig () pyplot.close ()  

The problem is that the x-axes starts with 0 and with my solution in things a little It is confused because then it will show battery level for this action. 0.

Is there any way to start with X-Access 1?

try it,

  dat = [1,2,4 , 7,8] Pappot.plot (NP .ange (lane) + 1, dat, color = '# 3399FF') pyplot.ylabel ('level') pyplot.xlabel ('number of actions') pipette.uptitles (' Battery ') Pallet. Xlim (xmin = 1)  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -