I know I can specify tick lengths using the Ticks option in Plot and related functions, and I also know about the CustomTicks package. But I stumbled over the symbols

(* 4 *)


(* 2.5 *)

and am curious if I could just set these to globally change tick sizes, without ever specifying the Ticks option in plots. Changing these values, however, does not seem to have any effect. Does anyone know what these constants are there for?

  • $\begingroup$ You can set defaults for CustomTicks using SetOptions[LinTicks,MajorTickLength -> {0.04, 0}] or similar. However, you still need to tell Plot to actually use LinTicks. $\endgroup$ – Felix Aug 12 '17 at 0:35
  • $\begingroup$ Yes, I know. I am just curious about these constants. $\endgroup$ – JEM_Mosig Aug 12 '17 at 1:17
  • $\begingroup$ Charting`$MajorTickLength is builtin private symbol, it is not related to the CustomTicks package. I doubt that it is possible to set the default tick lengths by setting such a constant because I believe ticks are handled by the front end. My understanding is that if the ticks are set to Automatic, they will be fully generated by the front end, while the symbol you are referring to lives in the kernel. These are of course just some educated guesses. I could be wrong. $\endgroup$ – Szabolcs Aug 12 '17 at 7:58

The only place I've found an effect is

Block[{Charting`$MajorTickLength = 15},
 CandlestickChart[{"C", {{2010, 1, 1}, {2010, 1, 15}}}, 
  TrendStyle -> {Green, Red}]

Mathematica graphics

Compare with the default:

CandlestickChart[{"C", {{2010, 1, 1}, {2010, 1, 15}}}, 
 TrendStyle -> {Green, Red}]

Mathematica graphics

There are probably other functions like CandlestickChart, which calls Charting`CategoricalAxis[], which uses Charting`$MajorTickLength.

Simon Woods found a user-level function that is affected by both Charting`$MajorTickLength and Charting`$MinorTickLength, namely PairedBarChart.

If it's any help, several internal functions (inspect ? Charting`*Scale functions) that use the following, which uses the minor tick length:

  • 2
    $\begingroup$ PairedBarChart is affected by both the major and minor setting. $\endgroup$ – Simon Woods Aug 13 '17 at 12:25
  • $\begingroup$ @SimonWoods Thanks. I figured there would be some other *Chart functions, but my enthusiasm for tracking them all down was waning. $\endgroup$ – Michael E2 Aug 13 '17 at 12:30
  • $\begingroup$ @SimonWoods For me, PairedBarChart does not respond to changing Charting`$MajorTickLenth. The major ticks always seem cut off by numbers. Do you have an example? $\endgroup$ – Michael E2 Aug 13 '17 at 12:38
  • $\begingroup$ e.g. here $\endgroup$ – Simon Woods Aug 13 '17 at 12:41
  • $\begingroup$ @SimonWoods OK, maybe I had a typo in $MajorTickLength -- it's all working now. Thanks again and sorry for the trouble. $\endgroup$ – Michael E2 Aug 13 '17 at 12:45

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.