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
Post a Comment