I would like to generate set of four axis relating wavelength, wavenumber, energy and frequency in an arbitrary range. Like in this image but without the labels such as "RADAR".

example of ruler

The selection of the nice numbers could be done similar to plots with two x-axis with different units but without an ordinate "y axis".

range = {Quantity[0.1, "THz"], Quantity[10, "THz"]};
ticksmeV = FindDivisions[QuantityMagnitude@UnitConvert[Quantity["Planck's constant"] #, "meV"] & /@ range, 10]

{0, 5, 10, 15, 20, 25, 30, 35, 40, 45}

and so on. But I'm not clear how to put this in a graphic with correct scaling. What would be the best way to do this both in linear and logarithmic scaling?


Based in the answer by @ubpdqn I have done this:

rangeTHz = Quantity[{0.1,10}, "THz"];
rangemeV = UnitConvert[Quantity["Planck's constant"] #, "meV"] & /@ rangeTHz;
range\[Lambda] =  N@UnitConvert[Quantity["Speed of Light"]/#, "micrometer"] & /@ rangeTHz
rangeWn = N@UnitConvert[#/Quantity["Speed of Light"], "Wavenumbers"] & /@ rangeTHz
TableForm@Table[HorizontalGauge[Null, k, GaugeFrameStyle -> Transparent,  ScalePadding -> {0, 0}, ScaleDivisions -> 10, GaugeMarkers -> None, GaugeLabels -> Placed[QuantityUnit@First@k, Top], ImageSize -> 600, GaugeFaceStyle -> Transparent, LabelStyle -> 16,  AspectRatio -> 1/15], {k, {rangeTHz, rangemeV, range\[Lambda], 

Mathematica graphics

but the problem is that the Wavelength scaling should be inverted. How can I fix that?

  • 1
    $\begingroup$ Never used it, but by reading the documentation maybe ScalingFunction->"Reverse" could do the trick? You'll have to dispose of Table and create the list manually, I guess. $\endgroup$ – Peltio Jul 9 '14 at 15:04
  • $\begingroup$ @Peltio, it seems that ScalingFunction->"Reverse" have no effect on HorizontalGauge. $\endgroup$ – rhermans Jul 9 '14 at 17:24

Perhaps HorizontalGauge. Obviously you can format and change from static to suit your needs:

HorizontalGauge[36, {0, 45}, GaugeFrameStyle -> Gray, 
 ScalePadding -> {.08, .1}, ScaleDivisions -> 10, 
 GaugeMarkers -> None, GaugeLabels -> Placed["meV", Above], 
 ImageSize -> 400, GaugeFaceStyle -> LightBlue, 
 GaugeFaceElementFunction -> "GlassRectangle", LabelStyle -> 16]

enter image description here


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.