Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: Table NDSolve Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121997] Re: Table NDSolve Plot
  • From: Helen Read <readhpr at gmail.com>
  • Date: Sat, 8 Oct 2011 05:34:40 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j6jofa$m25$1@smc.vnet.net> <j6meam$76r$1@smc.vnet.net>

What version of Mathematica are your using? The DisplayFunction business 
has not been necessary since approximately version 6.

Try your example without all the DisplayFunction->Identity and 
DisplayFunction->$DisplayFunction and it will work just fine, as long as 
you omit the semi-colon at the end of the Show[].

And if you need a semi-colon at the end of the Show (for example if it's 
inside a Module with other stuff after the Show), just wrap it in Print.

Print[Show[]];

Helen

On 10/7/2011 4:47 AM, Dr. Wolfgang Hintze wrote:
>
>>
> The trick is to use DisplayFunction to create various plots "silently"
> and then display them using Show.
>
> Here is an example of how to combine just two plots
>
> h = 0;
> n = 0;
> k = 0.25;
> s = NDSolve[{(h - k^2*n*(1 + n)*z^2)*w[z] - z*(1 + k^2 -
> 2*k^2*z^2)*D[w[z], z] + (1 - z^2)*(1 - k^2*z^2)*D[w[z], {z, 2}] == 0,
> w[2] == 1,
> Derivative[1][w][2] == -1}, w[z], {z, 1.1, 3.}];
> p[1] = Plot[Evaluate[w[z] /. s], {z, 1.1, 3.}, PlotStyle ->  Automatic,
> DisplayFunction ->  Identity];
> p[2] = Plot[(1/2)*Log[(z + 1)/(z - 1)], {z, 1.1, 3.}, PlotStyle ->
> Automatic, DisplayFunction ->  Identity];
> Show[{p[1], p[2]}, DisplayFunction ->  $DisplayFunction];
>
> Wolfgang
>
>






  • Prev by Date: Re: Baffled by notebook history
  • Next by Date: Rank of a matrix depending on a variable
  • Previous by thread: Re: Table NDSolve Plot
  • Next by thread: Setting parameters via Manipulate?