Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Tick Values on Gauges
Replies: 2   Last Post: Oct 3, 2013 10:25 PM

 Messages: [ Previous | Next ]
 David Park Posts: 1,560 Registered: 5/19/07
Re: Tick Values on Gauges
Posted: Oct 3, 2013 10:10 PM

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@comcast.net> djmpark@comcast.net

<http://home.comcast.net/~djmpark/index.html>
http://home.comcast.net/~djmpark/index.html

From: Alexei Boulbitch [mailto:Alexei.Boulbitch@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@iee.lu

Date Subject Author
10/3/13 David Park
10/3/13 Alexei Boulbitch