Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5080

Plot axis length and size ratio (TwoPlot revive)

From matyigtm <matyigtm@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Plot axis length and size ratio (TwoPlot revive)
Date 2011-09-19 11:11 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j5781h$jac$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hi,

I want to combine two plots with the same "x" axis into one graphic.
Because the two plots have different magnitude, I choosed the "Inset"
command inside of one of the two plots. I want to put the two "y" axes
on left and right for the two plots, resp. (aka. TwoPlot)
My problem is that the two plots take different sizes when the numbers
written at the ticks on the "y" axis get different length, or when
AxesLabel is used. I've understood the the area of the plot is
extended by PlotRangePadding and with ImagePadding, but I cannot
retrieve the latter from the plots to get the right sizes.

The Inset command help a lot to position the origins of the two plots,
but its "size" parameter looses any relation to the coordinates used
in the plots.

The following example illustrates the problem, the hardcoded number
1.045 is to be programmed to give good results.

plt2 = Plot[x (x - 10) Cos[x], {x, 0, 10}, PlotStyle -> Red,
AxesOrigin -> {10, 0}, AxesStyle -> Red];
Plot[x Sin[x], {x, 0, 10},  Epilog -> Inset[plt2, {0, 0}, {0, 0}, 10 *
1.045]

Any idea to align the two plots is appreciated,
Matyi



Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Plot axis length and size ratio (TwoPlot revive) matyigtm <matyigtm@gmail.com> - 2011-09-19 11:11 +0000
  Re: Plot axis length and size ratio (TwoPlot revive) Ray Koopman <koopman@sfu.ca> - 2011-09-22 11:33 +0000
  Error Message on Magnification "Tong Shiu-sing" <sstong@phy.cuhk.edu.hk> - 2011-09-23 07:46 +0000
    Re: Error Message on Magnification Helen Read <readhpr@gmail.com> - 2011-09-25 02:34 +0000
  Re: Plot axis length and size ratio (TwoPlot revive) Armand Tamzarian <mike.honeychurch@gmail.com> - 2011-09-25 02:43 +0000
    Re: Plot axis length and size ratio (TwoPlot revive) matyigtm <matyigtm@gmail.com> - 2011-09-27 10:22 +0000
  Re: Error Message on Magnification Tomas Garza <tgarza10@msn.com> - 2011-09-25 02:44 +0000
  Re: Error Message on Magnification "Tong Shiu-sing" <sstong@phy.cuhk.edu.hk> - 2011-09-25 02:46 +0000
  Re: Error Message on Magnification "Tong Shiu-sing" <sstong@phy.cuhk.edu.hk> - 2011-09-26 08:18 +0000

csiph-web