Learn how to plot a chart with Python!
Main code:
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
labels = [1, 2, 3, 4]
time = [1, 2, 3, 4]
strength = [2, 3, 5, 11]
ax.plot(time, strength, 'r-s', label = 'Plot')
for i in range(len(time)):
ax.text(time[i]-0.15, strength[i]+0.2, '{}' .format(strength[i]))
ax.set_title('Class 4')
ax.set_xlabel('Time')
ax.set_ylabel('Strength')
ax.legend()
ax.grid()
a = ['a', 'b', 'c', 'd']
plt.xticks([1, 2, 3, 4], a)
b = ['a', 'b', 'c', 'd', 'e', 'f']
plt.yticks([1, 3, 5, 7, 9, 11], b)
plt.show()
En esta página del sitio puede ver el video en línea Chart Axes on Python (Matplotlib) - CLASS 4 de Duración hora minuto segunda en buena calidad , que subió el usuario Fala tu, Nerd! 05 septiembre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 32 veces y le gustó 6 a los espectadores. Disfruta viendo!