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


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

Plot axis length and size ratio (TwoPlot revive)

Started bymatyigtm <matyigtm@gmail.com>
First post2011-09-19 11:11 +0000
Last post2011-09-26 08:18 +0000
Articles 9 — 6 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  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

#5080 — Plot axis length and size ratio (TwoPlot revive)

Frommatyigtm <matyigtm@gmail.com>
Date2011-09-19 11:11 +0000
SubjectPlot axis length and size ratio (TwoPlot revive)
Message-ID<j5781h$jac$1@smc.vnet.net>
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



[toc] | [next] | [standalone]


#5143

FromRay Koopman <koopman@sfu.ca>
Date2011-09-22 11:33 +0000
Message-ID<j5f6ec$q95$1@smc.vnet.net>
In reply to#5080
On Sep 19, 4:11 am, 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

It may take a little messing around to get values of shift, scale,
and tix that give you what you want, but something like this might
work for you.

With[{shift = 0, scale = .2, tix = Range[-20,20,5]},
Plot[{x Sin[x], shift + scale * x(x-10)Cos[x]},{x,0,10},
PlotStyle->{Black,Orange}, Frame->True, FrameLabel->{None,
"x Sin[x]  (black)", None, "x (x-10) Cos[x]  (orange)"},
FrameTicks->{Automatic, Automatic, None, {shift+scale*#,#}&/@tix}]]

[toc] | [prev] | [next] | [standalone]


#5157 — Error Message on Magnification

From"Tong Shiu-sing" <sstong@phy.cuhk.edu.hk>
Date2011-09-23 07:46 +0000
SubjectError Message on Magnification
Message-ID<j5hdgd$7j9$1@smc.vnet.net>
In reply to#5080
Dear All,

The following error message keeps on appearing in my Mathematica 8, 
repeatedly

"The specified setting for the option Magnification cannot be used."

The message reappears even if I close all the files and launch Mathematica 
again. I don't know what setting on magnification that I have set 
accidentally and how to fix it. Grateful if anyone can help.

Regards,
Dominic 

[toc] | [prev] | [next] | [standalone]


#5175 — Re: Error Message on Magnification

FromHelen Read <readhpr@gmail.com>
Date2011-09-25 02:34 +0000
SubjectRe: Error Message on Magnification
Message-ID<j5m3v4$pi2$1@smc.vnet.net>
In reply to#5157
On 9/23/2011 3:46 AM, Tong Shiu-sing wrote:
> Dear All,
>
> The following error message keeps on appearing in my Mathematica 8,
> repeatedly
>
> "The specified setting for the option Magnification cannot be used."
>
> The message reappears even if I close all the files and launch Mathematica
> again. I don't know what setting on magnification that I have set
> accidentally and how to fix it. Grateful if anyone can help.

I frequently get that error message when trying to insert text into a 
graphic using the Drawing Tools. I don't know what causes it. Sometimes 
just trying again -- several times -- will eventually get it to work.


-- 
Helen Read
University of Vermont

[toc] | [prev] | [next] | [standalone]


#5188

FromArmand Tamzarian <mike.honeychurch@gmail.com>
Date2011-09-25 02:43 +0000
Message-ID<j5m4hb$pns$1@smc.vnet.net>
In reply to#5080
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

[toc] | [prev] | [next] | [standalone]


#5247

Frommatyigtm <matyigtm@gmail.com>
Date2011-09-27 10:22 +0000
Message-ID<j5s84h$peb$1@smc.vnet.net>
In reply to#5188
I've found this in wolfram's library:
http://reference.wolfram.com/mathematica/howto/GeneratePlotsWithTwoVerticalScales.html

I find it nice, because it only plots two times the required
functions, but it's ticks seem to be ugly, and it cannot accept
options for the plots.

Matyi

[toc] | [prev] | [next] | [standalone]


#5190 — Re: Error Message on Magnification

FromTomas Garza <tgarza10@msn.com>
Date2011-09-25 02:44 +0000
SubjectRe: Error Message on Magnification
Message-ID<j5m4j8$po9$1@smc.vnet.net>
In reply to#5080
Perhaps you might start by looking at the option inspector in the Format me
nu. Select Global|NotebookOptions|DisplayOptions and see what is the value 
set for Magnification (last item on the right hand side). Alternatively, 
in the Window menu, check for Magnification and, if possible, choose 
one of the values in the list.
-Tomas

> Date: Fri, 23 Sep 2011 03:43:36 -0400
> From: sstong@phy.cuhk.edu.hk
> Subject: Error Message on Magnification
> To: mathgroup@smc.vnet.net
>
> Dear All,
>
> The following error message keeps on appearing in my Mathematica 8,
> repeatedly
>
> "The specified setting for the option Magnification cannot be used."
>
> The message reappears even if I close all the files and launch Mathematica
> again. I don't know what setting on magnification that I have set
> accidentally and how to fix it. Grateful if anyone can help.
>
> Regards,
> Dominic
>
>

[toc] | [prev] | [next] | [standalone]


#5197 — Re: Error Message on Magnification

From"Tong Shiu-sing" <sstong@phy.cuhk.edu.hk>
Date2011-09-25 02:46 +0000
SubjectRe: Error Message on Magnification
Message-ID<j5m4n3$pp8$1@smc.vnet.net>
In reply to#5080
Thanks for the suggestion, but all options seem to be normal, the value 
of the Magnification is set to 1. for the Display Options and 100% for 
Window > Magnification at the menu item.

The error appears every time I enter Mathematica, and every time I leave 
a beep and the same message appears.

A red background appears on EVERY plot I make in EVERY notebook, and the 
error message appears in the message box. The red background disappears 
when I re-size the notebook, change it display, or select the cell and 
choose Format > Clear Formatting. But it is so annoying that I could not 
work properly.

I wonder if it is a problem in the setting, or a bug in Mathematica. 
Please help.


  Perhaps you might start by looking at the option inspector in the 
Format menu. Select Global|NotebookOptions|DisplayOptions and see what 
is the value set for Magnification (last item on the right hand side). 
Alternatively, in the Window menu, check for Magnification and, if 
possible, choose one of the values in the list.


  -Tomas



  > Dear All,
  >
  > The following error message keeps on appearing in my Mathematica 8,
  > repeatedly
  >
  > "The specified setting for the option Magnification cannot be used."
  >
  > The message reappears even if I close all the files and launch 
Mathematica
  > again. I don't know what setting on magnification that I have set
  > accidentally and how to fix it. Grateful if anyone can help.
  >
  > Regards,
  > Dominic
  >
  >

[toc] | [prev] | [next] | [standalone]


#5217 — Re: Error Message on Magnification

From"Tong Shiu-sing" <sstong@phy.cuhk.edu.hk>
Date2011-09-26 08:18 +0000
SubjectRe: Error Message on Magnification
Message-ID<j5pcg7$8h4$1@smc.vnet.net>
In reply to#5080
The User Interface Group of Wolfram Research has helped me solve the 
problem. The problem seems to come from a bad style definition in 
$UserBaseDirectory. I don't remember I made any changes to the stylesheet 
anyway, but when I renamed the whole directory and let Mathematica created a 
new one, the error disappeared.

Thank you all for your kind attention on this matter. Your suggestions are 
much appreciated.


----- Original Message ----- 
From: "Tong Shiu-sing" <sstong@phy.cuhk.edu.hk>
To: <mathgroup@smc.vnet.net>
Sent: Sunday, September 25, 2011 10:36 AM
Subject: Re: Error Message on Magnification


> Thanks for the suggestion, but all options seem to be normal, the value
> of the Magnification is set to 1. for the Display Options and 100% for
> Window > Magnification at the menu item.
>
> The error appears every time I enter Mathematica, and every time I leave
> a beep and the same message appears.
>
> A red background appears on EVERY plot I make in EVERY notebook, and the
> error message appears in the message box. The red background disappears
> when I re-size the notebook, change it display, or select the cell and
> choose Format > Clear Formatting. But it is so annoying that I could not
> work properly.
>
> I wonder if it is a problem in the setting, or a bug in Mathematica.
> Please help.
>
>
>  Perhaps you might start by looking at the option inspector in the
> Format menu. Select Global|NotebookOptions|DisplayOptions and see what
> is the value set for Magnification (last item on the right hand side).
> Alternatively, in the Window menu, check for Magnification and, if
> possible, choose one of the values in the list.
>
>
>  -Tomas
>
>
>
>  > Dear All,
>  >
>  > The following error message keeps on appearing in my Mathematica 8,
>  > repeatedly
>  >
>  > "The specified setting for the option Magnification cannot be used."
>  >
>  > The message reappears even if I close all the files and launch
> Mathematica
>  > again. I don't know what setting on magnification that I have set
>  > accidentally and how to fix it. Grateful if anyone can help.
>  >
>  > Regards,
>  > Dominic
>  >
>  >
> 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web