Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9096
| From | psycho_dad <s.nesseris@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Cool example with ContourPlot+EvaluationMonitor |
| Date | 2012-03-17 07:51 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jk1fpb$4v0$1@smc.vnet.net> (permalink) |
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 — Next in thread | Find similar | Unroll 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