Bob Hanlon
Block[{$DisplayFunction = Identity}, plt1 =
Plot[Sin[x], {x, -Pi, Pi}];
plt2 = Plot[Sin[x]/x, {x, -4Pi, 4Pi}]
];
Show[
Graphics[
{Rectangle[{0, 0}, {1, 1}, plt1],
Rectangle[{0.55, 0.15}, {0.95, 0.5}, plt2]
}]
]
Regards
Jens
<mar...@gmail.com> schrieb im Newsbeitrag
news:echef8$ope$1...@smc.vnet.net...
Use Rectangle as in
Block[{$DisplayFunction = Identity},
g1 = Plot[Sin[x], {x, 0, 2*Pi}]; g2 = Plot[Cos[x], {x, 0, Pi}]; ];
Show[Graphics[{Rectangle[{0, 0}, {5, 1}, g1], Rectangle[{3, 0}, {4, 2},
g2]}]];
HTH,
Jean-Marc
> I am generating graphs in mathematica 5.0 that I export to
> eps for use in latex.
> I have two graphics objects each from MultipleListPlot[.],
> However I cannot seem to find a way to place a graph inside
> another graph (the inside graph being smaller and in an upper
> corner having it's own axis but within the frame of the
> larger graph). If anyone knows an easy method to do this, or
> any method at all I would appreciate it.
Use Rectangle[]. It's explained in the online documentation where there are
a few examples.
Here is another. First generate some data.
lst1 = Random[] & /@ Range[10];
lst2 = Random[] & /@ Range[10];
lst3 = Random[] & /@ Range[10];
Plot them
p1 = MultipleListPlot[lst1, lst2, PlotStyle -> {Red, Blue},
PlotRange -> {0, 1}];
p2 = MultipleListPlot[lst2, lst3, PlotStyle -> {Blue, Green},
PlotRange -> {0, 1}];
Display the second plot in the top right of the first.
p3 = Show[p1, Epilog -> {Rectangle[{6, .6}, {10.5, 1}, p2]}];
Regards,
Dave.
p1 = Plot[Sin[x], {x, 0, 2Pi}];
p2 = Plot[Cos[x], {x, 0, 2Pi}];
p12 = Show[p1, Graphics[{Rectangle[{3.5, 0.4}, {5.5, 1.2}, p2]}]]
Bye!
Jose
-----Mensaje original-----
De: mar...@gmail.com [mailto:mar...@gmail.com]
Enviado el: Miércoles, 23 de Agosto de 2006 06:16 a.m.
Para: math...@smc.vnet.net
Asunto: Graph inside another graph
Hello,
David Park
dj...@earthlink.net
http://home.earthlink.net/~djmp/
plt1 = Plot[Sin[2x], {x, 0, 2p},
PlotStyle -> Blue, Frame -> True, ImageSize -> 150]
Plot[BesselJ[0, x], {x, 0, 4p}, PlotStyle ->
Red, Epilog -> Rectangle[{6, 0.4}, {12, 1.0}, plt1], Frame -> True]
Cheers,
Brian