4
$\begingroup$

I've read Mike Honeychurch's answer here, and while it tells me how to change the font size on all of my plots, that size change affects (I think) all text on the plot. I would like to be able to make all my axis labels 14 point by default and not necessarily affect anything else.

That is of course possible in the Plot command, for example, by the TicksStyle option. If you look in Core.nb, in the Graphics StyleData (see the post above for a screen shot), there doesn't appear to be anything specific to tick labels, and searching core.nb for that string doesn't produce anything useful.

Finally, the solution given in the post above does not allow changing of the color of the tick label font as far as I can tell. Changing the FontColor changes only the color of graphics text inserted into the graphic. So I'd also like a way to do that.

So what am I missing? (I must say, I find the whole default option setting thing extremely overcomplicated. The cascading structure is great, but the user interface is less than nice, the documentation sucks [why can't Wolfram publish a list of all the settable options and what each one controls? Someone has to know this stuff], and the whole thing reminds me of the Windows registry disaster.)

EDIT: Perhaps I wasn't clear. I know about the TicksStyle option to the Plot command. But I would like to set one default somewhere that will by default use (say) 14 point red labels for tick labels in Plot, RegionPlot, Graphics, and any other 2-D Graphics objects you can think of.

$\endgroup$
  • $\begingroup$ I am not sure I understand you well but is this helpful : TicksStyle doc ? $\endgroup$ – SquareOne Feb 18 '15 at 23:56
  • $\begingroup$ +1 For the "windows registry disaster(TM)" $\endgroup$ – Dr. belisarius Feb 19 '15 at 0:21
  • 1
    $\begingroup$ Have you ever seen the "AIX registry abortion"?, BTW :) $\endgroup$ – Dr. belisarius Feb 19 '15 at 0:23
  • $\begingroup$ Plot[x^2, {x, 0, 1}, TicksStyle -> Red] $\endgroup$ – David G. Stork Feb 19 '15 at 0:50
  • 1
    $\begingroup$ I can't remember who did it first, but both of them were the same as...tonishing thing. $\endgroup$ – Dr. belisarius Feb 19 '15 at 2:43
2
$\begingroup$

I've found a way to do it, it seems to work :

  1. Open the Option Inspector window (in the Format menu)

  2. Type in the search box : ticks

  3. There is a DefaultTicksStyle (GraphicsBoxOptions) entry
    (beware, there is very similar entry for 3D: DefaultTicksStyle (Graphics3DBoxOptions))

  4. Change the value of this entry to any you want. All the changes you make here are instantly taken into account in the opened notebooks so you can control visually the result.
    (but beware : if you want to define also a default color like I did below, be sure to give the RGBColor description and not the named symbols like Red, Blue ... I did that first and it crashed the whole session !!!)

  5. Dont't forget to choose the scope ("Global Preferences" in your case)

Here is the test i made :

enter image description here

$\endgroup$
  • $\begingroup$ Thanks. I will try that. What I was ideally looking for, however, was a way to have such an option with less than global scope (for example, in a stylesheet), so that it could apply in some notebooks but not others. It looks like you haven't found a way to do that either. $\endgroup$ – rogerl Feb 19 '15 at 15:11
  • $\begingroup$ @rogerl I see ... Maybe I have an idea then ... I'll update in case it works. $\endgroup$ – SquareOne Feb 19 '15 at 15:32
2
$\begingroup$

You just need to add the ticks style that you want to the Graphics style in your style sheet. It is analogous to the answer of mine that you have referenced.

Cell[StyleData["Graphics"],
 GraphicsBoxOptions->{
 DefaultTicksStyle->Directive[FontSize->14,FontColor->RGBColor[1,0,0]]}]

enter image description here

$\endgroup$
  • $\begingroup$ Works very well ;) $\endgroup$ – SquareOne Feb 20 '15 at 15:49
  • $\begingroup$ Thanks. Now, how was I supposed to know that? There is no page for GraphicsBoxOptions in the online help. And even if there were, how would I know what I could add as options? The documentation leads you in the direction of SetOptions, but SetOptions[GraphicsBox, DefaultTicksStyle -> Directive[FontSize -> 14, FontColor -> RGBColor[1, 0, 0]]]' gets Improperly formatted directive'. Am I missing something? $\endgroup$ – rogerl Feb 20 '15 at 23:15
  • $\begingroup$ I agree that documentation for this kind of thing is lacking. Having said that, in my answer to another question that you referenced you can see a screen grab of the graphics style options fron the core style sheet. Near the bottom is the default ticks style. $\endgroup$ – Mike Honeychurch Feb 21 '15 at 0:42

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.