Fix label for special

This commit is contained in:
Janita Willumsen 2023-09-12 20:58:45 +02:00
parent 67b23770e1
commit 9e900b8369

View File

@ -2,6 +2,7 @@ import matplotlib.pyplot as plt
import numpy as np import numpy as np
def main(): def main():
fig, ax = plt.subplots()
x = [] x = []
gen_alg = [] gen_alg = []
spec_alg = [] spec_alg = []
@ -13,11 +14,11 @@ def main():
gen_alg.append(float(gen_i)) gen_alg.append(float(gen_i))
spec_alg.append(float(spec_i)) spec_alg.append(float(spec_i))
plt.plot(x, gen_alg, label=f"general algorithm") ax.plot(x, gen_alg, label=f"General algorithm")
plt.plot(x, spec_alg, label=f"general algorithm") ax.plot(x, spec_alg, label=f"Special algorithm")
plt.legend() ax.legend()
plt.savefig("../latex/images/problem10.pdf") fig.savefig("../latex/images/problem10.pdf")
if __name__ == "__main__": if __name__ == "__main__":
main() main()