MathGroup Archive 1997

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

Search the Archive

Re: Plotting two functions on different y-axes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg7966] Re: Plotting two functions on different y-axes
  • From: murray at math.umass.edu (Murray Eisenberg)
  • Date: Wed, 30 Jul 1997 02:37:30 -0400
  • Organization: University of Massachusetts, Amherst
  • Sender: owner-wri-mathgroup at wolfram.com

siafra at vaxsa.csied.unisa.it wrote:
: I'm a student in physics at the University of Salerno, Italy and I'm using 
: Mathematica 3.0 under Win95. My question is :
: how can I plot two functions f(x), g(x) with the same x range on two different 
: y-axes, say the one for f(x) at left and the one for g(x) at right ?
: Thanks.

Easy -- use GraphicsArray.  For example:

f=Plot[Sin[x], {x, 0, Pi}, DisplayFunction -> Identity];
g= Plot[x - x^3/6, {x, 0, Pi}, DisplayFunction -> Identity];
Show[GraphicsArray[{f, g}]];

Here DisplayFunction -> Identity suppresses display of the individual
plots.  GraphicsArray[{f, g}] creates the array, and Show wrapped
around that causes the result to be displayed.

--
  Murray Eisenberg                       Internet:  murray at math.umass.edu
  Mathematics & Statistics Dept.            Voice:  413-545-2859 (W)
  University of Massachusetts                       413-549-1020 (H)
  Amherst, MA 01003                           Fax:  413-545-1801


  • Prev by Date: Re: subscripts in function definitions
  • Next by Date: Re: Q: implementation of Dot
  • Previous by thread: Plotting two functions on different y-axes
  • Next by thread: read data in the "1.234*10^-8" form?