Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can I find the default font parameters (family, size, etc.) for the text that appears in Graphics produced by Plot, ListPlot, LogPlot, etc.?

I'm interested not only in the font specs used for axis and plot labels, but also (and importantly) in those for the numbers displayed next to tick marks.

EDIT: At the moment there appears to be two entirely different ways to set these parameters, and it is not clear to me which one takes precedence. One, suggested by ybeltukov, is through Format->EditStylesheet.... The other one, described in the post linked to by Kuba, is through SetOptions[Graphics, BaseStyle -> {...}].

share|improve this question

2 Answers 2

Font family, size, etc. depends on "Graphics" style in the notebook stylesheet

CurrentValue[{StyleDefinitions, "Graphics", "FontSize"}]
 (* 10 *)

CurrentValue[{StyleDefinitions, "Graphics", "FontFamily"}]
 (* "Times" *)

You can manually change it: open Format->Edit Stylesheet..., add

 Cell[StyleData["Graphics"],FontSize->20]

and press Ctrl+Shift+E. You will see that the font in Plot,LinePlot, etc. instantly increase.

Edit: default values for Plot, ListPlot, etc. separately can be set by

SetOptions[Plot, BaseStyle -> {FontFamily -> "Helvetica", FontSize -> 16}]
share|improve this answer
    
So I was wrong. Thanks, I wasn't paying attention to StyleDefinitions :) You can mention the TraditionalForm for Labels issue. Also, one have to be aware the SetOptions is sometimes tricky - How can I... –  Kuba Sep 5 '13 at 21:07
    
@Kuba What is Labels issue? Both methods (SetOptions and edit stylesheet) work for plot and axis labels. –  ybeltukov Sep 5 '13 at 21:20
    
That labels are by default in TraditionalForm. I know SetOptions will work here but just to point out it is not always work for other functions. I find your answer great, those are just details. –  Kuba Sep 5 '13 at 21:31
    
@Kuba Can you give an example? I've noticed that if I change TraditionalForm style, it overwrite Graphics style for plot and axes labels and numbers on axes. Moreover, there are GraphicsLabel style, which affects axes labels and numbers (not plot label!). –  ybeltukov Sep 5 '13 at 22:02
    
I was referring to PlotLabel > Details. –  Kuba Sep 5 '13 at 22:17

I figured this out quite by accident, and I will show you why, but the short answer to your question is to Find the length of the command and then display that. For example, consider the plot function.

 In[50]:= Length[Plot[x, {x, 0, 1}]]

 Out[50]= 2

Now we can look at these two elements and you will see all:

You can see the hue (Hue[0.67, 0.6, 0.6]) of the classic blue line in

 Plot[x, {x, 0, 1}][[1]]

You can see all sorts of other hidden details in

 Plot[x, {x, 0, 1}][[2]]

For example, the default aspect ratio is 1/GoldenRatio.

I will show you how I found this, why, and how I changed a function that I could not otherwise change. I was trying to make polyhedral nets, and the function

 PolyhedronData["Disphenocingulum", "NetImage"]

gives a net, but there is no way to change this baby barf yellow color. What I did was this. I computed and looked at

 PolyhedronData["Disphenocingulum", "NetImage"][[1]]

I saw that this ugly yellow was RGBColor[1, 1, 0.85]. I replaced the regular polyhedron data function with

 Graphics[
 ReplacePart[
 PolyhedronData["Disphenocingulum", "NetImage"][[1]], 
  1 -> FaceForm[RGBColor[1, 1, 1]]]]

Eureka, I made the background white and never gave it a second thought until today. I feel like I answered your question. As for me, I had no choice but to find these hidden details, as I could not figure out how to manipulate the built in function otherwise.

I think this method should show the hidden guts of pretty much every function you have in mind.

share|improve this answer
2  
try FullForm, such as Plot[Sin[x],{x,0,2 Pi}]//FullForm –  Pinguin Dirk Sep 5 '13 at 20:27
    
Hah! Dirk that is indeed a much faster way. I see all. Very good. –  J. W. Perry Sep 5 '13 at 20:33
4  
InputForm is very useful too for examining graphics expressions, it's easier to read than FullForm. –  Simon Woods Sep 5 '13 at 20:54

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.