# Plotting function with unique symbols [closed]

I would like to plot a function which involves multiple symbols created using Unique. Consider the following simple example.

X = {Unique["x"]}
Plot[Evaluate[2 X[[1]]], {Evaluate[X[[1]]], 0, 1}]


Unfortunately, this results in an error Plot::write: "Tag Evaluate in Evaluate[X[[1]]] is Protected.".

Is there a way to plot using "dynamic" variables?

## closed as off-topic by m_goldberg, bbgodfrey, user9660, Öskå, ubpdqnFeb 8 '16 at 9:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, bbgodfrey, Community, Öskå, ubpdqn
If this question can be reworded to fit the rules in the help center, please edit the question.

• Related, possible duplicate: (7756), (20718), (46751) – Mr.Wizard Feb 7 '16 at 14:49
• @Mr.Wizard It seems to me the underlying problem is that Evaluate should be placed outside the list, Evaluate@{X[[1]], 0, 1}. This is the issue in many posts, such as (5235) and (47907), and is also explained in this answer. I couldn't find one in which the issue was specifically using Evaluate in the second argument to Plot. It's usually the first argument. – Michael E2 Feb 7 '16 at 17:09
• @MichaelE2 Yes, those are good, perhaps better, originals. And I found another related question and added it to my comment above. This question seems headed toward closure as "in the documentation" at this point; hopefully the links are useful to Markus and others. – Mr.Wizard Feb 7 '16 at 17:14
• Thank you very much for the links. – Markus Müller Feb 7 '16 at 17:56

If you have a relatively recent version of Mathematica, you don't need to use Evaluate.
X = {Unique["x"]};

• Using X={Unique["x"]};Plot[Legended[2 X[[1]], X[[1]]], {X[[1]], 0, 1}] does not work. I need something that works for symbol lists. – Markus Müller Feb 7 '16 at 13:45
• Sorry if my question was not clear. I fixed it. Basically, I am wondering how to plot a function which depends on "dynamic" variables created using Unique. – Markus Müller Feb 7 '16 at 14:00
• With solves the problem. Thanks. – Markus Müller Feb 7 '16 at 14:02