반응형
import matplotlib.pyplot as plt
X=(1,2,4,8)
Y=([1, 0.222, 0.011,0.014],
[1, 0.230, 0.044, 0.230],
[1, 0.535, 0.638, 0.280],
[1, 1.215, 0.672, 0.562])
fig,ax=plt.subplots()
ax:plt.Axes
ax.set_xlabel("Processes")
ax.set_ylabel("Speedup")
for y in Y:
ax.plot(X,y,"-o")
ax.legend(("n=256","n=1024","n=4096","n=16384"))
plt.show()
import numpy as np
import matplotlib.pyplot as plt
accuracies=np.random.rand(40)
fig,ax=plt.subplots()
ax:plt.Axes
ax.set_xlabel("Number of rounds")
ax.set_ylabel("Accuracy")
ax.plot(range(1,len(accuracies)+1),accuracies)
ax.set_yticks(np.linspace(0,1,11))
plt.ylim(0,1)
plt.show()
반응형