7
$\begingroup$

how do I get the name and definition of a builtin Mathematica functions? For instance, I would like to see how default Tick plotting function is implemented. However, it is not clear where it is and what is its name, because its name never appears for the user. Example:

Plot[ {Sin[x], Cos[x]}, {x, 0, 3 Pi}, Frame -> True, FrameTicks -> {None, Automatic}]

Basically I want to know, how do I get the name of the function called under the Automatic label? Thanks!

$\endgroup$
4
  • 1
    $\begingroup$ Look at FindDivisions. This gives you something that is reasonably close to what is actually used. $\endgroup$
    – rcollyer
    Sep 4, 2014 at 16:26
  • $\begingroup$ I fear there is no straightforward way for many Automatically set options. You need to don you helmet, grab your pickaxe and prepare for world-class spelunking (mind you, there are several experienced miners around here). $\endgroup$
    – Yves Klett
    Sep 4, 2014 at 16:29
  • $\begingroup$ @rcollyer thanks! This is was the underlying reason for the question. To know the general answer would be very interesting, though $\endgroup$
    – Karolis
    Sep 4, 2014 at 16:47
  • 1
    $\begingroup$ To see the effect of an Automatic option you can often use AbsoluteOptions; however, this is broken in v10. Using v9, plt = Plot[{Sin[x], Cos[x]}, {x, 0, 3 Pi}, Frame -> True, FrameTicks -> {None, Automatic}]; AbsoluteOptions[plt, FrameTicks] $\endgroup$
    – Bob Hanlon
    Sep 4, 2014 at 17:40

2 Answers 2

6
$\begingroup$

We can start with:

Names["*`*Ticks*"]

(* { ...
   , System`Dump`FrameTicksToBoxes
   , ...
   , System`Dump`ParseFrameTicks
   , ...
   , System`Dump`ProcessSymbolicFrameTicks
   , System`Dump`ProcessSymbolicFrameTicksStyle
   , ...
   }
*)

Some of the returned names are suggestive. We can examine their definitions using, for example, ?? System`Dump`ParseFrameTicks.

The Mathematica documentation actively encourages spelunking. See this question about spelunking tools for more information about viewing the in-memory definitions of functions.

$\endgroup$
5
$\begingroup$

The Commands (and its variants);

?? Plot
Attributes[Plot]
Options[Plot]
Information["*Tick*"]
Documentation`HelpLookup["*Tick*"]

will be of some help and provide additional Information. The latter will open a Help-Window.

Check also:

How can one find undocumented options or option values in Mathematica?

What are some useful, undocumented Mathematica functions?

enter image description here

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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