Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm sure this must have been asked before but I am unable to find anything here on SE or on Google in general.

I simply want to know what the default color and thickness are for a Frame on a Plot and for the Axes.

Looking in the help seems to send me down a rabbit hole of,

The default style of axes is specified by the option DefaultAxesStyle.

For Graphics, the default setting is DefaultAxesStyle->"GraphicsAxes"

And although I can use GraphicsAxes as an option value, eg FrameStyle->"GraphicsAxes" I still can't discover what the actual shade of gray and line thickness that is. Are these deliberately hidden somewhere, or I am not looking hard enough?

Many thanks,

share|improve this question
    
Have a look here Is there a method to look inside at the internal code of Built-In functions?, is this helpful? – Louis Jan 28 at 16:18
    
Good question. If you look at FullForm[Plot[Sin[x], {x, 0, 1}, Frame->True] or leave the Frame off, no head contains AxesStyle or FrameStyle so I also am stuck pondering what are the color and thickness of for the defaults "GraphicsAxes" and "GraphicsFrame". – Jack LaVigne Jan 28 at 17:03
up vote 12 down vote accepted

Hunting through the stylesheets is effective, but does not necessarily give you the current value being used if it has been modified. Instead, use

CurrentValue[{StyleDefinitions , "GraphicsAxes"}]
(* {Arrowheads -> {}, LineColor -> GrayLevel[0.4], Thickness -> Absolute[0.2]} *)

CurrentValue[{StyleDefinitions , "GraphicsFrame"}]
(* {LineColor -> GrayLevel[0.4], Thickness -> Absolute[0.5]} *)
share|improve this answer
    
Nice code! I just tried to help myself and applied CurrentValue[{StyleDefinitions, "FrameTicksStyle"}] to get the values from a ListDensityPlotit brings {} What am I doing wrong? – Kay Apr 11 at 13:30
    
@Kay if you notice, the query is not "AxesStyle" or "FrameStyle", but "GraphicsAxes" and "GraphicsFrame". Extrapolating from that, you're looking for "GraphicsFrameTicks", not "FrameTicksStyle", and you get {ScriptLevel -> 1, LineColor -> GrayLevel[0.4]}, in 10.4. – rcollyer Apr 11 at 13:50
    
right! thank you! – Kay Apr 11 at 14:28

The styles "GraphicsAxes" and "GraphicsFrame" are defined in the stylesheet "Core.nb".

  • To access to this file use the menu : format/edit stylesheet
  • Then in the notebook that appears click on Default.nb
  • In the new notebook that appears click on Core.nb
  • Then the notebook core.nb appears.
  • Go to section :"style for Mathematica System-specific Elements" and open it
  • Go to the cell "default Box style" and open it
  • Go to "Local definition for style Graphics"
  • Select the cell "GraphicsAxes"
  • Do Control-Shift-E (on Windows, otherwise you can use the menu : Cell/ShowExpression)
  • Then you see :

    Cell[StyleData["GraphicsAxes"], Arrowheads->{}, LineColor->GrayLevel[0.4], Thickness->Absolute[0.2]]

This is the internal structure of the cell. One can see the settings for the style "GraphicsAxes"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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