Re: Labelling a plot with maximum
- To: mathgroup at smc.vnet.net
- Subject: [mg105155] Re: Labelling a plot with maximum
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Mon, 23 Nov 2009 06:49:07 -0500 (EST)
- References: <heb69h$abg$1@smc.vnet.net>
Manipulate[
max = NMaximize[f[x, \[CapitalDelta]], x];
Plot[f[x, \[CapitalDelta]], {x, -1.22, 1.22},
PlotRange -> {{-0.5, 0.5}, {0, 1.5}},
Epilog -> {Text[max, Scaled[{0, 1}], {-1, 1}], PointSize[0.025],
Point[{max[[2, 1, 2]], 0}]}], {\[CapitalDelta], 0.125, 0.5}]
As far as I know Export does not export to Quicktime. Try an .avi
instead and convert with one of the transcoding tools freely available
on the internet.
Cheers -- Sjoerd
On Nov 22, 1:11 pm, Shalin Mehta <shalin.me... at gmail.com> wrote:
> Hi everyone,
>
> I am very new to Mathematica. I wish to prepare a figure and a movie
> where the maximum of the plot is labelled on the figure.
>
> I am using Manipulate to animate a function as shown below:
>
> jinc[x_] := BesselJ[1, 2 \[Pi] x]/(2 \[Pi] x);
> f[x_, \[CapitalDelta]_] :=
> 4 Abs[jinc[x + \[CapitalDelta]] - jinc[x - \[CapitalDelta]]]^2;
> Manipulate[
> Plot[f[x, \[CapitalDelta]], {x, -1.22, 1.22},
> PlotRange -> {{-0.5, 0.5}, {0, 1.5}}], {\[CapitalDelta], 0.125,
> 0.5}]
>
> I find the maximum for different values of Delta using:
> Manipulate[
> NMaximize[f[x, \[CapitalDelta]], x], {\[CapitalDelta], 0.125,
> 0.5}]
>
> Can someone please help with a code that can print the result returned
> by NMaximize on (say) top-left of the Plot generated by the first
> Manipulate above? The plot will look neat if I can place a marker at
> the X-position of maximum.
>
> Also, I wish to have a Motion-JPEG compressed quicktime mov file
> exported from this manipulate. How can that be achieved?
>
> thanks in advance for any help.
> Shalin
>
> mobile: +65-90694182
> blog: shalin.wordpress.com
>
> Bioimaging Lab, Block-E3A, #7-10
> Div of Bioengineering, NUS Singapore 117574
> website:http://www.bioeng.nus.edu.sg/optbioimaging/colin/people.asp#shali=
nm