# Is plot polluting my context?

Bug introduced in 10.0.2 or earlier and fixed in 10.1.0

Whenever I plot something 3 temporary variables get added to my current context.

Example (fresh Kernel):

Plot[x, {x, -1, 1}];
Names["Global*"]


Output:

{"x", "$3", "$4", "\$5"}


When I do the same thing 100 times it adds 300 temporary vars in total.

Do[Plot[x, {x, -1, 1}], {100}];
Names["Global*"] // Length


Output:

301


This is probably not a big issue for plots inside a notebook. However, if a function relies on plot (like FindAllCrossings) wouldn't the function pollute it's context if it is called repeatedly?

I wondered if this would slow down calls to other objects in that context (if for example 10000 temporary variables had been added).

So I'd just like to know whether my observations are correct or whether I'm totally on the wrong track here.

• What a coincidence! I reported this to WRI about 10 minutes before you posted. But I didn't realize that it was Plot that did it. I was blaming the summary boxes from InterpolatingFunction. – Szabolcs Nov 21 '14 at 19:25
• This only happens in v10, not v9 or v8. – Szabolcs Nov 21 '14 at 19:33
• I'm provisionally tagging this as a bug, since I do not think this is desired behavior. – J. M. will be back soon Jul 4 '15 at 5:13
• @Szabolcs This happens in 10.0.2 but not 10.1.0. Do you know when it was introduced? – Mr.Wizard Jul 4 '15 at 5:54
• Maybe related: (58375), (64394) – Mr.Wizard Jul 4 '15 at 5:56

In[18]:= Remove["Global*"]