Message Boards Message Boards

0
|
4374 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

I don´t kow where to place Dynamic in the Plot.

I give a short example attach to this post.

a = 4;
Animator[Dynamic[a], {0., 2 Pi, .1}, AnimationRunning -> False]
Show[
 Plot[Cos[x], {x, 0, 2 Pi}, 
  Ticks -> {{{Pi, Pi, {.03, .02}}, 2 Pi}, {-1, 0, 1}}, 
  AspectRatio -> Automatic, PlotStyle -> GrayLevel[0.8], 
  ImageSize -> {720, 120}, PlotRange -> {{0, 6}, {-1, 1}}],
 (* Where do i put Dynamic in the next plot, so that it coordinate \
with the Animator?
    It gives mi a error with Dynamic[Plot[Cos[x],{x,0,a}]]]
  *)
 Plot[Cos[x], {x, 0, a}]
 ]
Attachments:
POSTED BY: Ernesto Espinosa
2 Replies

Thanks Chad. It works.

Best regards

POSTED BY: Ernesto Espinosa

A simple option is to wrap the entire Show[...] expression with Dynamic.

POSTED BY: Chad Knutson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract