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()
On this page of the site you can watch the video online Chart Axes on Python (Matplotlib) - CLASS 4 with a duration of hours minute second in good quality, which was uploaded by the user Fala tu, Nerd! 05 September 2022, share the link with friends and acquaintances, this video has already been watched 32 times on youtube and it was liked by 6 viewers. Enjoy your viewing!