-2

enter image description here

two plots in one figure with legends and symbols in maple

Mike
  • 4,041
  • 6
  • 20
  • 37
Yas
  • 1
  • 3

1 Answers1

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]);

enter image description here

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]);

enter image description here

acer
  • 6,671
  • 15
  • 15