I'm just started learning python and I got a little problem with my code
I need yMin start from 60 and yMax=100, but why my results like this?
Can someone please help me?
this my code
import matplotlib.pyplot as plt
import numpy as np
data = [
["{:.2}".format(0.80443), "{:.2}".format(0.84176), "{:.2}".format(0.84278), "{:.2}".format(0.82316),"{:.2}".format(0.82260)],
["{:.2}".format(0.71956), "{:.2}".format(0.77691), "{:.2}".format(0.77279), "{:.2}".format(0.74522),"{:.2}".format(0.74747)],
["{:.2}".format(0.84256), "{:.2}".format(0.83268), "{:.2}".format(0.84152), "{:.2}".format(0.84204),"{:.2}".format(0.83775)],
["{:.2}".format(0.71956), "{:.2}".format(0.77691), "{:.2}".format(0.77279), "{:.2}".format(0.74522),"{:.2}".format(0.74747)],
["{:.2}".format(0.80320), "{:.2}".format(0.83787), "{:.2}".format(0.83933), "{:.2}".format(0.82087),"{:.2}".format(0.82008)],
["{:.2}".format(0.71956), "{:.2}".format(0.77043), "{:.2}".format(0.76772), "{:.2}".format(0.74286),"{:.2}".format(0.74432)],
["{:.2}".format(0.83641), "{:.2}".format(0.83009), "{:.2}".format(0.83847), "{:.2}".format(0.83743),"{:.2}".format(0.83333)],
["{:.2}".format(0.71956), "{:.2}".format(0.77043), "{:.2}".format(0.76772), "{:.2}".format(0.74286),"{:.2}".format(0.74432)],
]
year = ['set1', 'set2', 'set3', 'set4', 'set5']
plt.plot(year, data[0])
plt.plot(year, data[1])
plt.plot(year, data[2])
plt.plot(year, data[3])
plt.plot(year, data[4])
plt.plot(year, data[5])
plt.plot(year, data[6])
plt.plot(year, data[7])
plt.xlabel('xx')
plt.ylabel('aa')
plt.title('bb')
plt.show()
If i change my format ex : "{:.2%}".format(0.80443)
so this my results
I want to change the decimal number to percent and round it up to two decimal places. that's why I use format - @bigben


.formatting your data?.format()returns a formatted string, which is not what you want.