Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.1K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

A little problem with overlay of graphics

Posted 6 years ago

Hello everybody! I try to use "Inset" to include small plots in a larger plot, and I have a problem of frontiers... Here is an illustration from the documentation. A function p1

p1 = Plot[{Sin[x], Sin[2 x]}, {x, 0, 2 \[Pi]}, ImageSize -> 200, 
  Frame -> True, Background -> LightYellow]

An overlay:

ParametricPlot[{Sin[x], Sin[2 x]}, {x, 0, 4 \[Pi]}, Frame -> True, 
 Prolog -> Inset[p1, {1, -.5}]]

Unfortunately, half of the first plot is lost! What can I do to really superimpose both windows, even if the yellow one go beyond the Lissajous curve region?

Regards, Claude

POSTED BY: Claude Mante
3 Replies

Thanks Neil, that's what I needed!

POSTED BY: Claude Mante

Claude,

If you really wanted the inset hanging off the side, I suggest:

ParametricPlot[{Sin[x], Sin[2 x]}, {x, 0, 4 \[Pi]}, Frame -> True, 
 ImageSize -> Large, Prolog -> Inset[p1, {1, -.5}], 
 PlotRangePadding -> {{0.1, .7}, {0.1, 0.1}}]

to get:

enter image description here

Regards,

Neil

POSTED BY: Neil Singer

Claude,

You put the inset in the wrong place. Adjust the x,y coordinates a bit. I also made the main plot bigger to get more room for the plot and adjusted the vertical to align the axis:

ParametricPlot[{Sin[x], Sin[2 x]}, {x, 0, 4 \[Pi]}, Frame -> True, 
 ImageSize -> Large, Prolog -> Inset[p1, {.56, -.02}]]

gives you

enter image description here

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard