The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David Park

Posts: 1,560
Registered: 5/19/07
Re: Tick Values on Gauges
Posted: Oct 3, 2013 10:10 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



From: Alexei Boulbitch []

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

Dear David,

I asked recently a very close question at the StackExchange:

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.


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


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.