Message Boards Message Boards

0
|
3018 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Unexpected local variables in SliceContourPlot3D?

Hello!

Today I was trying to display a slice plot of a function of three coordinates using SliceContourPlot3D and noticed an unexpected side-effect: local variables which were used inside this function remain in the system and retain their numerical values.

For example, running the very first example from the Documentation Center:

SliceContourPlot3D[
 Exp[-(x^2 + y^2 + z^2)], "CenterPlanes", {x, -2, 2}, {y, -2, 
  2}, {z, -2, 2}]

creates three local variables i.e. x, y and z with their OwnValues being 2., 2. and 2. respectively. It appears that these values correspond to the upper plotting bounds inside the SliceContourPlot3D function.

The worst thing is actually that I cannot clear these values and turn my x, y and z back into symbols - ClearAll[x, y, z] throws an error "Cannot clear local variable z". Is it a known bug / already reported issue? Are there wayarounds?

POSTED BY: Nikolay Shilov
2 Replies
Posted 3 years ago

Hi Nikolay,

That looks like a bug. Existing values are overwritten. It is as if symbols scoped using Block are not being restored to their value in the outer scope. You should report it to Wolfram Support.

You can use Remove[x, y, z] to remove the symbols or Clear[x, y, z] to remove the OwnValues.

POSTED BY: Rohit Namjoshi

Wolfram developers are aware of this issue. We thank you for reporting it.

POSTED BY: Moderation Team
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