MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Drawing a Line From One Plot to Another


Hello everyone,

Say I have two plots, y=x^2 and y=2x,
aligned vertically using GraphicsColumn. 
Their domains are aligned because x runs
from -3 to +3 in both.  I'd like to be
able to draw a line from a point in the
top graph to a point in the bottom graph.  How can I do that?

Regards,

Gregory

Hi, Gregory,

Here is a minimalistic approach. Try it:

pl1 = Plot[x^2, {x, -3, 3}];
pl2 = Plot[2 x, {x, -3, 3}];

Show[{GraphicsColumn[{pl1, pl2}],
  Graphics[{Red, Thick,
    Line[{Scaled[{0.6, 0.12}], Scaled[{0.6, 0.64}]}]}]}]

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu






  • Prev by Date: Re: Simplify
  • Next by Date: Re: working with nested lists
  • Previous by thread: Re: Drawing a Line From One Plot to Another
  • Next by thread: Drawing a Line From One Plot to Another