two plots in one figure with legends and symbols in maple
Asked
Active
Viewed 754 times
1 Answers
0
Here are two ways. Adjust as needed. See the Help page for target plot,options .
restart;
exactsol := sin(2*x)*exp(x):
approxsol := sin(1.5*x)*exp(x):
plots:-display(
plot(exactsol, x=0..1, adaptive=false, numpoints=10,
style=pointline, symbol=solidcircle, color=black,
symbolsize=15, legend="Exact Solution"),
plot(approxsol, x=0..1, adaptive=false, numpoints=10,
style=pointline, symbol=solidbox, color=red,
symbolsize=15, legend="Approximate Solution"),
legendstyle=[location=right], size=[700,400]);
plots:-display(
plot(exactsol, x=0..1, adaptive=false, numpoints=10,
style=pointline, symbol=solidcircle, color=black,
symbolsize=15),
plot(approxsol, x=0..1, adaptive=false, numpoints=10,
style=pointline, symbol=solidbox, color=red,
symbolsize=15),
plot(0.6, 0.65..0.72, adaptive=false, numpoints=2,
style=pointline, symbol=solidcircle, color=black,
symbolsize=15),
plot(0.3, 0.65..0.72, adaptive=false, numpoints=2,
style=pointline, symbol=solidbox, color=red,
symbolsize=15),
plots:-textplot([0.75,0.6,"Exact Solution"],align=right),
plots:-textplot([0.75,0.3,"Approximate Solution"],align=right),
size=[700,400]);

acer
- 6,671
- 15
- 15
-
Thank you very much for your answer – Yas Nov 27 '20 at 06:01