# No plot appears when inside Manipulate

**URL:** <https://community.wolfram.com/t/no-plot-appears-when-inside-manipulate/2364>\
**Category:** Questions\
**Tags:** mathematica, graphics-and-visualization, interface-construction\
**Created:** [June 12, 2014, 10:03pm UTC](https://community.wolfram.com/t/no-plot-appears-when-inside-manipulate/2364 "2014-06-12T22:03:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erubino](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@erubino](https://community.wolfram.com/u/erubino)\
**Post date:** [June 12, 2014, 10:03pm UTC](https://community.wolfram.com/t/no-plot-appears-when-inside-manipulate/2364/1 "2014-06-12T22:03:50Z")

</div>

Hello everybody, I am having some issues with mathematica : I am trying to plot a function using “Manipulation”. I can see the axis but I can not see any plot of the function. I also tried with a simple plot (without “Manipulation”) by fixing some of the parameters. Here is my code using manipulation :

```
Manipulate[Plot[-J1^2 - k3 + (w^2/c^2) + (-1 + (wn1^2/wn1^2 + wn2^2 - w^2), {w, 0, 10}], {J1, 1, 10}, {c, 1, 10}, {k3, 1, 10}, {wn1, 1, 100}, {wn2, 1, 10}]

```

And here is my code using just “Plot”:

```
J1 = 1; c = 2; k3 = 5; wn1 = 5; wn2 = 3; k1=2;
Plot[-J1^2 - k3 + w^2/c^2 +k1 (-1 + wn1^2/(wn1^2 + wn2^2 - w^2)), {w, 0, 10}]

```

If anyone can help me I would appreciate a lot.

Thank you very much in advance

edoardo

---

<div class="post-metadata">

**Author:** ![dreiss](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dreiss/32/29094_2.png) [@dreiss](https://community.wolfram.com/u/dreiss)\
**Post date:** [June 12, 2014, 10:27pm UTC](https://community.wolfram.com/t/no-plot-appears-when-inside-manipulate/2364/2 "2014-06-12T22:27:33Z")

</div>

You are missing a bracket and appear to be missing a factor of **k1** in the argument of the **Plot** and the **Manipulate** functions also is missing iterator for the **k1** parameter. Here is your **Manipulate** with the bracket and the **k1** factor and iterator added–actually just copying the plot expression from your second bit of code:

```
Manipulate[
 Plot[-J1^2 - k3 + w^2/c^2 + 
   k1 (-1 + wn1^2/(wn1^2 + wn2^2 - w^2)), {w, 0, 10}], {J1, 1, 
  10}, {c, 1, 10}, {k3, 1, 10}, {wn1, 1, 100}, {wn2, 1, 10}, {k1, 1, 
  10}]

```

This yields a plot. Also you can initialize the values of your parameters to the ones that you specify as in the following:

```
Manipulate[
 Plot[-J1^2 - k3 + w^2/c^2 + 
   k1 (-1 + wn1^2/(wn1^2 + wn2^2 - w^2)), {w, 0, 10}],
 {{J1, 1}, 1, 10},
 {{c, 2}, 1, 10},
 {{k3, 5}, 1, 10},
 {{wn1, 5}, 1, 100},
 {{wn2, 3}, 1, 10},
 {{k1, 2}, 1, 10}]

```

Lesson learned: take a good look at your expressions and compare them. Here are your two different arguments of your **Plot** functions compared (with the syntactically missing bracket in the first one inserted but without the **k1** factor in the first one – by the way, the syntax coloring would give you a hit that something is wrong–minus the second one…):

```
(-J1^2 - k3 + (w^2/c^2) + (-1 + (wn1^2/wn1^2 + wn2^2 - w^2))) -
  -J1^2 - k3 + w^2/c^2 + 
  k1 (-1 + wn1^2/(wn1^2 + wn2^2 - w^2)) // Simplify

```

which does not give zero…it gives:

```
-2 k3 - w^2 + (2 w^2)/c^2 + wn2^2 + 
 k1 (-1 + wn1^2/(-w^2 + wn1^2 + wn2^2))

```
