2
$\begingroup$

I want to change SciDraw's default frame thickness and tick lengths, and I find myself changing them on each plot, which is really tedious. So I wrote a wrapper function, but that is still tedious, because it has to extract the plot range, etc. to create the LinTicks object:

range = PlotRange[plot];
XTicks -> 
 LinTicks[range[[1, 1]], range[[1, 2]], MinorTickLength -> .01, 
  MajorTickLength -> .02], YTicks -> 
 LinTicks[range[[2, 1]], range[[2, 2]], MinorTickLength -> .01, 
  MajorTickLength -> .02],

But then if I want to override the range, or use logticks, etc. I have to again set the tick lengths manually again.

How do I change the global default LineThickness, MinorTickLength, MajorTickLength etc.?

$\endgroup$
  • $\begingroup$ I don't have time for a full answer now, but I usually use styles. Read the section on styles in the documentation and look up DefineStyle. $\endgroup$ – Szabolcs Apr 4 '17 at 10:53
  • $\begingroup$ @Szabolcs, thanks, I'll look into that. $\endgroup$ – bjorne Apr 4 '17 at 10:54
3
$\begingroup$

SetOptions is what you are looking for. Here are my defaults for LinTicks, with a few more options as examples:

SetOptions[LinTicks,
  TickLabelFunction -> (MaTeX[If[# - Round[#] == 0, Round[#], #], 
      Magnification -> fontsize/12] &),
  MajorTickLength -> {0.04, 0},
  MinorTickLength -> {0.015, 0},
  MajorTickStyle -> {AbsoluteThickness[1], Black},
  MinorTickStyle -> {AbsoluteThickness[1], Black},
  TickLabelStep -> 1,
  ShowFirst -> True,
  ShowLast -> True
  ];

For the frame style, set the options for FigurePanel (again, with some more settings to illustrate what is possible):

SetOptions[FigurePanel,
  XFrameTextNudge -> {0, 8},
  YFrameTextNudge -> {3, 0},
  LineThickness -> 1,
  PanelLetter -> None];

Similarly, you can set defaults for any class.

$\endgroup$

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.