Re: Tick Values on Gauges
- To: mathgroup at smc.vnet.net
- Subject: [mg131787] Re: Tick Values on Gauges
- From: "djmpark" <djmpark at comcast.net>
- Date: Thu, 3 Oct 2013 22:27:03 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <2277.54355.1380784166474.JavaMail.root@m06>
Thanks Alexei, that gave me enough of a lead. This can easily be done with Presentations by turning the ScaleDivisions off and using an XTickLine in an Epilog option. The gauge is actually a Graphics expression inside a DynamicModule. So the following achieved the desired ticks on the gauge: << Presentations` HorizontalGauge[Dynamic[t], {-16, 16}, ScaleDivisions -> None, Epilog -> {XTickLine[{0, 1, 0}, {-16, 16}, {-16, 16, 4}, 4, XLabTickSpecs -> {0.05, 0.0}, XUnLabTickSpecs -> {0.025, 0.0}]}, ImageSize -> 300, Frame -> False] The Frame can be set to True while designing the gauge ticks. Of course, this only works for straight line gauges. Here is an example with the ThermometerGauge where we can put the tick lines across the thermometer tube. DynamicModule[{t = 0}, {ThermometerGauge[Dynamic[t], {-16, 16}, ScaleDivisions -> None, Epilog -> {YTickLine[{0, 1, -0.0}, {-16, 16}, {-16, 16, 4}, 4, YLabTickSpecs -> {0.18, 0.0}, YUnLabTickSpecs -> {0.1, 0.0}]}, ImageSize -> 60, Frame -> False], Dynamic[t]}] The only problem is that this exposes a flaw with ThermometerGauge. Whenever the first argument is a Dynamic[variable] the upper portion of the thermometer is not drawn! And on the ThermometerGauge Function page there is not a single example of using a Dynamic variable! Of course, we all know that thermometers can't be used as input devices so maybe it's not that bad. David Park <mailto:djmpark at comcast.net> djmpark at comcast.net <http://home.comcast.net/~djmpark/index.html> http://home.comcast.net/~djmpark/index.html From: Alexei Boulbitch [mailto:Alexei.Boulbitch at iee.lu] Does anyone know how to specify custom tick values on gauges? I would like to have an output gauge that has a range of -16 to 16 in steps of 4. The following, however, insists on using spacings of 5. VerticalGauge[fval, {-16, 16}, ScaleDivisions -> {8, 1}] This seems to be another unnecessary design restriction imposed by WRI. There is a Ticks option but it does not work. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/index.html <http://home.comcast.net/%7Edjmpark/index.html> Dear David, I asked recently a very close question at the StackExchange: http://mathematica.stackexchange.com/questions/28348/how-to-fix-ticks-in-gau ges As much as you can see from the answers to my question, there is no satisfactory solution. In any non-standard case one has to build a considerable part of the gauge himself. This we can do, however, also without the WRI gauge template. Best, Alexei Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L-5326 Contern, LUXEMBOURG Office phone : +352-2454-2566 Office fax: +352-2454-3566 mobile phone: +49 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu