# Updating PlotLabels when using Manipulate for multiple plots

**URL:** <https://community.wolfram.com/t/updating-plotlabels-when-using-manipulate-for-multiple-plots/19888>\
**Category:** Questions\
**Tags:** graphics-and-visualization, interface-construction\
**Created:** [April 13, 2022, 6:43pm UTC](https://community.wolfram.com/t/updating-plotlabels-when-using-manipulate-for-multiple-plots/19888 "2022-04-13T18:43:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkhannacfoi](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gkhannacfoi](https://community.wolfram.com/u/gkhannacfoi)\
**Post date:** [April 13, 2022, 6:43pm UTC](https://community.wolfram.com/t/updating-plotlabels-when-using-manipulate-for-multiple-plots/19888/1 "2022-04-13T18:43:17Z")

</div>

Hello – I have several examples of trying to show the change of some parameter on the shape of a function. I am plotting the “base” function (i.e., `Sin[x]`) and using the Manipulate function to show the changes of the function: `a Sin[k x + phi]`. The issue comes when I use the Manipulate function to superimpose the two functions. I would like the PlotLabel of the function being manipulated to update in real time. I’m running into the following issue:

```
Manipulate[
 Plot[{Sin[x], a Sin[k x + phi]}, {x, 0, 2 Pi}, 
  PlotLabels -> Placed[Automatic, Above]],
 {k, .1, 4}, {a, 1, 2}, {phi, 0, 2 Pi}
 ]

```

And here is the output. As you can see, the label for the “static” function is showing up fine… but the label for the function that is being manipulated is garbled.

Any suggestions would be welcome!

 ![ScreenShot2022-04-13at11.41.29AM.png](https://global.discourse-cdn.com/wolfram/original/3X/a/2/a27adbfa5ac4574c516f3317ffd52560e9b4a024.png)

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [April 14, 2022, 2:17am UTC](https://community.wolfram.com/t/updating-plotlabels-when-using-manipulate-for-multiple-plots/19888/2 "2022-04-14T02:17:29Z")

</div>

Hi Gaurav,

`Manipulate` scopes local variables by default. To avoid that, add the option `LocalizeVariables -> False`.

 ![8814plot.png](https://global.discourse-cdn.com/wolfram/original/3X/2/e/2e1ebfe647a7a5e2c7b64d16942bffdb99eb30c1.png)

To show the actual values of `k`, `a`, `phi`

```
Manipulate[
 Plot[{Sin[x], Evaluate[a Sin[k x + phi]]}
  , {x, 0, 2 Pi}
  , PlotLabels -> Placed["Expressions", Above]]
 , {k, .1, 4}, {a, 1, 2}, {phi, 0, 2 Pi}
 , LocalizeVariables -> False]

```

 ![10518plot.png](https://global.discourse-cdn.com/wolfram/original/2X/f/fc016f0e1dd05df93a3c8a9c60eb1813734c7e72.png)

---

<div class="post-metadata">

**Author:** ![gkhannacfoi](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gkhannacfoi](https://community.wolfram.com/u/gkhannacfoi)\
**Post date:** [April 14, 2022, 3:02am UTC](https://community.wolfram.com/t/updating-plotlabels-when-using-manipulate-for-multiple-plots/19888/3 "2022-04-14T03:02:06Z")

</div>

Rohit – thanks for your response and that seemed to work!

---

<div class="post-metadata">

**Author:** ![gkhannacfoi](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gkhannacfoi](https://community.wolfram.com/u/gkhannacfoi)\
**Post date:** [April 14, 2022, 3:40am UTC](https://community.wolfram.com/t/updating-plotlabels-when-using-manipulate-for-multiple-plots/19888/4 "2022-04-14T03:40:23Z")

</div>

Rohit – I actually think what did the trick was the `Evaluate` function. You can see the actual expressions even if you remove the `LocalizeVariables -> False` condition.
