TransWikia.com

Set options once for all, for all Plot-like functions

Mathematica Asked on December 16, 2020

Currently, to have default font size values for my graphs I do the following:

SetOptions[{Plot},TicksStyle->Directive[50],AxesStyle-> Directive[50]];

However it will only do the job for Plot function. There are many others (like ListPlot, LogPlot, etc). Of course I could manually add them in the list given as first parameter here.

But I would like to know if there is a way to say something like "for all functions that uses the option "TicksStyle" put TicksStyle->Directive[50] so that it will be done once for all for all the possible function using it ?

One Answer

SetOptions[EvaluationNotebook[], 
  GraphicsBoxOptions -> Join[{ImageSize -> Medium, 
     DefaultTicksStyle -> Directive[FontSize -> 20, FontColor -> Red,
        LineColor -> Green, Thickness -> Large], 
     DefaultAxesStyle -> {FontSize -> 20, LineColor -> Blue}, 
     Options[GraphicsBox]}]];

Grid @ Partition[{Plot[Sin[x], {x, 0, 2 Pi}], 
   LogPlot[x^5, {x, 0, 100}], 
   BarChart[{1, 2, 3}], 
   ContourPlot[x y, {x, 0, 1}, {y, 0, 1}, Frame -> False, Axes -> True]}, 2]

enter image description here

enter image description here

Answered by kglr on December 16, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP