How do you set custom ticks on an AngularGauge.

AngularGauge[π, {0, 2 π}, ScaleOrigin -> {0, 2 π}, 
 ScaleDivisions -> {8, 2}, TargetUnits -> "Radians", 
 GaugeLabels -> "Radians"]

enter image description here

The documentation says it has the same options as Graphics but Ticks seems to have no effect. I have tried both of the following to get the major ticks:

Ticks -> {Range[0, 2 π, π/4], Automatic}
Ticks -> {Automatic, Range[0, 2 π, π/4]}

I would like to get $\frac{n\pi}{4}$ for $n\in \{0 ...7\}$ as major ticks with TraditionalForm labels. Also minor ticks at $\frac{(2n-1)\pi}{8}$ for $n\in \{0 ...7\}$.

Is this possible?

  • $\begingroup$ @MarcoB I'm using ScaleDivisions with no joy. Have a look at the code. I'm asking for exactly what I described but it is not cooperating. $\endgroup$ – Edmund Feb 4 '16 at 1:36
  • $\begingroup$ Yes, sorry about that. I realized that as soon as I hit the "Add comment" button :-) $\endgroup$ – MarcoB Feb 4 '16 at 1:36
  • $\begingroup$ After playing around a bit, it seems to me that Gauge passes the ScaleDivisions settings to FindDivision to find the positions of the ticks. This would be good news, if it wasn't for the fact that only a subsets of FindDivision syntax forms is accepted. For instance, FindDivisions[{0, 2 Pi, {Pi/4, Pi/8}}, {8, 2}] would generate the ticks that you like, but that syntax is not supported in ScaleDivisions. $\endgroup$ – MarcoB Feb 4 '16 at 2:16
  • $\begingroup$ @MarcoB FindDivisions[{0, 2 Pi, {Pi/4, Pi/8}}] will work after its bug is fixed. I'll revisit this and try ScaleDivisions -> {0, 2 Pi, {Pi/4, Pi/8}}. Maybe it will work then. $\endgroup$ – Edmund Feb 4 '16 at 2:43
  • $\begingroup$ In my opinion ScaleDivisions is equivalent to the second argument of FindDivisions. In this connection, although the one-argument version you mention does not work, the two-argument version does: FindDivisions[{0, 2 Pi, {Pi/4, Pi/8}}, {5, 4}]. Unfortunately one cannot specify increments in the Gauge range as you would in FindDivisions though. Or am I misunderstanding your point? In any case, I hope they fix / extend the gauge functionality! $\endgroup$ – MarcoB Feb 4 '16 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.