Message Boards Message Boards

0
|
6235 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Page 117-Mathematica Beyond Mathematics - Par. value in graph label and { }

Posted 6 years ago

On page 117, in Mathematica Beyond Mathematics it states "You can also include a drop - down button.This will automatically be added when a parameter \ contains five or more choices as shown in the next example.In this \ case we have the possibility to choose several filling alternatives \ for displaying a graph.We use the Plot option : Filling.We also use PlotLabel to show the parameter value when \ labeling the graph.Notice that the combination of Plot options with \ Manipulate greatly increases the number of possible combinations for \ dynamic interactions.Manipulate[ Plot[Sin[nx], {x, 0, 2 [CapitalPi]},

I do not get PlotLabel changing the parameter in labeling the graph. In addition, I receive a list of 2 elements where the second element is the null set.

See attachment.

Why does the parameter not change in labeling the graph? Also why do I get a list that includes {Null}? Filling [RightArrow] choice, PlotRange [RightArrow] 2, PlotLabel [RightArrow] Style[StringForm["Sin(nt ) representation for n= 1", PaddedForm[n, {4, 2}]], 10]], {n, 1, 20}, {{choice, None, "Choice"}, {None, Axis, Top, Bottom, Automatic, 1, 0.5, 0, -0.5, -1}}, ContentSize [RightArrow] {200, 150}]"

However, when I type the following:

Manipulate[
 Plot[Sin[n x], {x, 0, 2 \[Pi]}, Filling -> choice, PlotRange -> 2,
  PlotLabel -> Style[StringForm["Sin(n t) representation for n='1'",
     PaddedForm[n, {4, 2}]], 10]],
 {n, 1, 20},
 {{choice, None, "Choice"},
  {None, Axis, Top, Bottom, Automatic, 1, 0.5, 0, -0.5, -1}},
 ContentSize -> {200, 150}]

, I do not get

Attachments:
POSTED BY: Samuel Kohn
Posted 6 years ago

I found out the answer to my problem. To be correct you need to replace n='1' by 1. However, I do not understand why I receive {Null} as output. Any suggestions will be very helpful.

Attachments:
POSTED BY: Samuel Kohn
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