13
$\begingroup$

I have been messing around with built in Experimental`Explore[] function. You can call the function in Mathematica yourself to see what it looks like. It is a GUI that allows you to change plot options to see how they affect a graph.

I find the idea very useful in helping somehow learn how to code graphs as they can see the graph and code next to each other. The user can immediately see how the code changes as they add and subtract options visually using the GUI.

Experimental`Explore[] is broken but parts of it still work. I am now building my own. One part that I am interested in keeping is the code preview panel that updates with current code on the fly (as you can see in the bottom left in pic below.)

enter image description here

Here is some code I am trying to add to to get the code preview window but not sure how to get started. Ideas?

Manipulate[Plot[Sin[x], {x, -3, 3},
  AxesLabel -> {xlabel, ylabel},
  Ticks -> {tics, tics}],
 Control[{{tics, Automatic, ""}, {Automatic -> "A", None -> "0"}}],
 Control[{{xlabel, "x", ""}, InputField, ImageSize -> {24, 24}}], 
 Control[{{ylabel, "y", ""}, InputField, ImageSize -> {24, 24}}]]
$\endgroup$
11
$\begingroup$

Quick fix is to use e.g. Inactivate and friends:

Manipulate[
 Column[{
     Activate @ #, 
     Panel @ ExpressionCell[
         # /. Inactive -> Defer, 
         "Notebook", "Input"
     ]
 }] & @ Inactivate @ Plot[Sin[x], {x, -3, 3}, 
     AxesLabel -> {xlabel, ylabel}, Ticks -> {tics, tics}]
 , 
 Control[{{tics, Automatic, ""}, {Automatic -> "A", None -> "0"}}], 
 Control[{{xlabel, "x", ""}, InputField, ImageSize -> {24, 24}}], 
 Control[{{ylabel, "y", ""}, InputField, ImageSize -> {24, 24}}]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.