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


Groups > comp.soft-sys.math.mathematica > #9155

Re: Cool example with ContourPlot+EvaluationMonitor

From Ralph Dratman <ralph.dratman@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Cool example with ContourPlot+EvaluationMonitor
Date 2012-03-19 10:05 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jk70d0$137$1@smc.vnet.net> (permalink)
References <jk1fpb$4v0$1@smc.vnet.net>

Show all headers | View raw


Could one of you please explain a little more? I think I get the
general idea about putting together the plot of an implicit function
by a sort of scanning process, but I don't understand the details.
Thank you.

Ralph

On Sun, Mar 18, 2012 at 3:43 AM, Murta <rodrigomurtax@gmail.com> wrote:
> Nice!.. I played with the code and made it shorter.
> It's the same thing.
>
> Dynamic[
>  ListPlot[data, Frame -> True, AspectRatio -> 1, PlotStyle -> Blue,
>  PlotRange -> {{-1.6, 1.6}, {-1.6, 1.6}}, Epilog -> Circle[{0, 0}]]]
> data = {}; freeze = 0.01
>
> ContourPlot[x^2 + y^2 == 1, {x, -1.5, 1.5}, {y, -1.5, 1.5},
>  EvaluationMonitor :> (AppendTo[data, {x, y}]; Pause[freeze])]
>
> []'s
> Murta
> On Mar 17, 4:51 am, psycho_dad <s.nesse...@gmail.com> wrote:
>> The following example shows in real-time (sort of) how ContourPlot calculates a contour (in this example a unit circle):
>>
>> f[x_, y_, freeze_] := (Pause[freeze]; (x^2 + y^2))
>> data = {}; freeze = 0.04;
>> Dynamic[ListPlot[data, Frame -> True, AspectRatio -> 1,
>>   PlotStyle -> Blue, PlotRange -> {{-1.6, 1.6}, {-1.6, 1.6}},
>>   Epilog -> Circle[{0, 0}]]]
>> ContourPlot[f[x, y, freeze] == 1, {x, -1.5, 1.5}, {y, -1.5, 1.5},
>>   EvaluationMonitor :> AppendTo[data, {x, y}]];
>>
>> Initially I just wanted to get all the points from ContourPlot, but then it dawned on me that using Dynamic I could do that in real time! I hope you like it :D
>>
>> Cheers
>>
>> PS Change the parameter freeze (set to 0.04 secs) to make the animation slower or faster.
>> PPS This is so cool, I just knew I had to share it!
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Cool example with ContourPlot+EvaluationMonitor psycho_dad <s.nesseris@gmail.com> - 2012-03-17 07:51 +0000
  Re: Cool example with ContourPlot+EvaluationMonitor Murta <rodrigomurtax@gmail.com> - 2012-03-18 07:50 +0000
  Re: Cool example with ContourPlot+EvaluationMonitor Ralph Dratman <ralph.dratman@gmail.com> - 2012-03-19 10:05 +0000
    Re: Cool example with ContourPlot+EvaluationMonitor psycho_dad <s.nesseris@gmail.com> - 2012-03-20 07:25 +0000
  Re: Cool example with ContourPlot+EvaluationMonitor David Kahle <david.kahle@gmail.com> - 2012-03-20 07:20 +0000
  Re: Cool example with ContourPlot+EvaluationMonitor "Kevin J. McCann" <kjm@KevinMcCann.com> - 2012-03-20 07:22 +0000
    Re: Cool example with ContourPlot+EvaluationMonitor psycho_dad <s.nesseris@gmail.com> - 2012-03-21 10:44 +0000
  Re: Cool example with ContourPlot+EvaluationMonitor "djmpark" <djmpark@comcast.net> - 2012-03-23 06:35 +0000

csiph-web