Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11420
| From | E. Martín-Serrano <eMartinSerrano@telefonica.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Drawing a Line From One Plot to Another |
| Date | 2012-08-20 08:16 +0000 |
| Message-ID | <k0sro5$jn0$1@smc.vnet.net> (permalink) |
| References | <k0d4b9$m8b$1@smc.vnet.net> <20120816055616.C876667E5@smc.vnet.net> |
| Organization | Time-Warner Telecom |
f2[x_]:=2 x
f1[x_]:= x^2
xmin =-3;
xmax= 3;
plotrange1={{-3.3,3.3},{-0.9,9.9}};
plotrange2={{-3.3,3.3},{-6.6,6.6}};
Manipulate[
Module[{isize =300},
xmin =-3;
xmax= 3;
pt11 ={xx, f1[xx]};
pt12 ={xx, plotrange1[[2]][[1]]};
g1 =Show[{Plot[f1[x],{x,xmin,xmax},PlotStyle-> Purple ],
Graphics[{{Red,Dashed, Line[{pt11 ,pt12}]}, Red,PointSize[.02],
Point[pt11], Black, Circle[pt11,Offset[4]]}]}, PlotRange -> plotrange1,
Axes-> True,AxesStyle->{Transparent,LightGray},Ticks->Automatic,Frame->
True,FrameStyle -> {{LightGray, LightGray},{Transparent,
LightGray}},FrameTicks -> False,ImageSize -> isize];
pt21 ={xx, f2[xx]};
pt22 ={xx, plotrange2[[2]][[2]]};
g2=Show[{Plot[f2[x],{x,xmin,xmax},PlotStyle-> Blue ], Graphics[{{Red,Dashed,
Line[{pt21 ,pt22}]}, Red,PointSize[.02], Point[pt21],Black,
Circle[pt21,Offset[4]]}]}, PlotRange -> plotrange2, Axes->
True,AxesStyle->{Transparent,LightGray},Ticks->Automatic,Frame->
True,FrameStyle -> {{LightGray,
LightGray},{LightGray,{Dashed,LightGray}}},FrameTicks -> False,ImageSize ->
isize];
Column[{g1,g2},Center,Spacings->0]],
{{xx,.6,"Current 'x' value"},xmin,xmax, ImageSize->Small}]
(* Try the slider and the Manipulate 'Autorun' *)
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Drawing a Line From One Plot to Another Gregory Lypny <gregory.lypny@videotron.ca> - 2012-08-14 09:04 +0000 Re: Drawing a Line From One Plot to Another Vincenzo Carrino <vincent.carrino@gmail.com> - 2012-08-15 07:33 +0000 Re: Drawing a Line From One Plot to Another "Alexander Elkins" <alexander_elkins@hotmail.com> - 2012-08-16 06:06 +0000 Re: Drawing a Line From One Plot to Another E. Martín-Serrano <eMartinSerrano@telefonica.net> - 2012-08-20 08:16 +0000 Re: Drawing a Line From One Plot to Another "Alexander Elkins" <alexander_elkins@hotmail.com> - 2012-08-29 05:19 +0000
csiph-web