Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2009

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

Search the Archive

Re: Re: Plot in Background of Manipulate

  • To: mathgroup at
  • Subject: [mg95247] Re: Re: Plot in Background of Manipulate
  • From: Alexei Boulbitch <Alexei.Boulbitch at>
  • Date: Mon, 12 Jan 2009 06:25:03 -0500 (EST)

Hi, Mike,
to add a bit to what David Park has written, I often use a simple approach like that you are looking for. But 
I do this not in order to fit experiment, but to fit a theoretical result which admits only numeric calculation, 
but which I need to use later in further analytical transformations. Find the example below. It is straightforward 
to apply the same approach to fit your experimental data, if you have an idea, of what the fitting function should
look like. 

(*  This is the data to be fitted and its plot  *)
dataToBeFitted = 
  Table[{z, NIntegrate[x^z*Exp[-z*x^2], {x, 0, 2}]}, {z, 0, 2, 0.1}];
plotOfDataToBeFitted = ListPlot[expdata, PlotStyle -> {Red, PointSize[0.015]}];

(*  This is a necessary plot of the fitting function manipulated by 3 parameters *)
(*  a, b and c with the data to be fitted on the background. Try this *)

   Plot[(a + b*Exp[-x^c]), {x, 0, 2}]}],  {{a, -1.8}, -3, 
  3}, {{b, 6.3}, 0, 10}, {{c, 0.3}, 0.1, 3}]

(* End of the example  *)

Like this I find sometimes pretty good analytic approximations to functions obtainable only in a numeric form.

Good luck,  :-) , Alexei

The following is a solution using the Presentations package. I hardly ever
use Manipulate to make dynamic displays. It is too baroque and it is much
easier to format and construct a presentation directly. You did not give
actual information about his data and model so here I have used a rather
simple example of matching a variable Sin curve to one that is randomly


 {amplitude = 1, phase = 0,
  ampexp = RandomReal[{-5, 5}], phaseexp = RandomReal[{0, 2 \[Pi]}]},
   phrase["Amplitude: ", Slider[Dynamic[amplitude], {0, 4}],
    Spacer[10], InputField[Dynamic[amplitude], FieldSize -> {5, 1}]],
   phrase["Phase: ", Slider[Dynamic[phase], {0, 2 \[Pi]}],
    Spacer[10], InputField[Dynamic[phase], FieldSize -> {5, 1}]],
    {(* Experimental curve *)
     Gray, Draw[ampexp Sin[t + phaseexp], {t, 0, 2 \[Pi]}],
     (* Adjustable theoretical curve *)
     Dynamic@Draw[amplitude Sin[t + phase], {t, 0, 2 \[Pi]}]},
    AspectRatio -> 1,
    PlotRange -> {{-.1, 2 \[Pi] + .1}, {-6.1, 6.1}},
    Frame -> True,
    ImageSize -> 400]
   ](* pagelet *),
  Style["Dynamic Matching of Experimental Curve", 16]
  ](* panelpage *)

The gray curve is the hypothetical experimental curve, generated randomly
each time the input is evaluated. The sliders can be used to adjust the
black theoretical curve to the experimental curve.

Peter Lindsay at the Mathematical Institute in the University of St Andrews
[ ] has kindly undertaken to maintain an archive that
provides downloadable notebooks and PDF files for various Presentations
solutions that have appeared on MathGroup. <> 

David Park
djmpark at <>  

From: makn87 at [mailto:makn87 at] 

If someone could please help with the following, I would really

I am plotting of some logarithmic scattering curves based on
theoretical modes and am using manipulate to change a few paramaters.

In the same notebook, I have plotted experimental results using
ListLogLogPlot (on the exact same scale as I have using the manipulate

I would like to have my experimental plots, plotted in the background
of the manipulate window, so that I can adjust the parameters in
manipulate to the point that my theoretical curve matches my
experimental curve.

So far I have only been able to plot the experimental plots side by
side with the manipulate generated plots by simply making each plot an
elements of a list. How do I combine them?

Alexei Boulbitch, Dr., Habil.
Senior Scientist

ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern

Phone: +352 2454 2566
Fax:   +352 2454 3566


This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.

  • Prev by Date: RE: Keeping plot annotations after regenerating a plot
  • Next by Date: Re: Graphics in PlotMarkers buggy in Mathematica 7
  • Previous by thread: Re: Plot in Background of Manipulate
  • Next by thread: Re: Solve / NSolve