Fix legend format
This commit is contained in:
parent
9e900b8369
commit
14a46d6057
@ -4,6 +4,7 @@ import numpy as np
|
||||
analytical_func = lambda x: 1 - (1 - np.exp(-10))*x - np.exp(-10*x)
|
||||
|
||||
def main():
|
||||
fig, ax = plt.subplots()
|
||||
for i in range(6):
|
||||
x = []
|
||||
y = []
|
||||
@ -19,12 +20,12 @@ def main():
|
||||
x.append(1.)
|
||||
y.append(0.)
|
||||
|
||||
plt.plot(x, y, label=f"n_steps={10**(i+1)}")
|
||||
ax.plot(x, y, label=f"n$_{{steps}} = 10^{i+1}$")
|
||||
|
||||
x = np.linspace(0, 1, 1001)
|
||||
plt.plot(x, analytical_func(x), label="analytical plot")
|
||||
plt.legend()
|
||||
plt.savefig("../latex/images/problem7.pdf")
|
||||
ax.plot(x, analytical_func(x), label=f"u$_{{exact}}$")
|
||||
ax.legend()
|
||||
fig.savefig("../latex/images/problem7.pdf")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user