Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5188
| From | Armand Tamzarian <mike.honeychurch@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Plot axis length and size ratio (TwoPlot revive) |
| Date | 2011-09-25 02:43 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j5m4hb$pns$1@smc.vnet.net> (permalink) |
| References | <j5781h$jac$1@smc.vnet.net> |
On Sep 19, 9:11 pm, matyigtm <matyi...@gmail.com> wrote:
> 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
There is this:
http://library.wolfram.com/infocenter/MathSource/7507/
which is for DateListPlot for could be modified for other plot types.
On one hand it is a lazy way of doing it because you create individual
plots and extract the info. On the other hand you can also combine bar
charts with your plots -- i..e like typical economic article plots
that combine a bar chart and line chart.
There is a tech conference coming up soon. Maybe people can ask for
this to be built in.
Mike
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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