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

MathGroup Archive 2012

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

Search the Archive

Re: Cool example with ContourPlot+EvaluationMonitor

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125588] Re: Cool example with ContourPlot+EvaluationMonitor
  • From: "Kevin J. McCann" <kjm at KevinMcCann.com>
  • Date: Tue, 20 Mar 2012 02:20:53 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jk1fpb$4v0$1@smc.vnet.net>

Another variation on a very cool theme.

f[x_, y_, freeze_] := (Pause[freeze]; x^2 + y^2)
data = {}; freeze = 0.01;
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},
   PlotPoints -> 30,
   EvaluationMonitor :> {AppendTo[data, {x, y}],
     If[Length[data] >= 600, data = Drop[data, 1]]}];

On 3/17/2012 3:51 AM, psycho_dad wrote:
> 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}]];



  • Prev by Date: Re: Different answers in mathematica and my calculator.
  • Next by Date: Problems reading text files with embedded delimiters
  • Previous by thread: Re: Cool example with ContourPlot+EvaluationMonitor
  • Next by thread: Re: Cool example with ContourPlot+EvaluationMonitor