0

When I specify tick marks in ArrayPlot I want to keep the number of trailing zero's that I specify. One work around is to use a label for that tick mark (i.e. Ticks->{0.8,0.9,{1.0,"1.0"},1.1,1.2}), but is there a neater solution to save me doing this manually?

For example if I generate a plot with the code

legend = {0.9996 + 0.0001 #, 0.9996 + 0.0001 #} & /@ {0, 1, 2, 3, 4, 5, 6, 7, 8};
ArrayPlot[legend, ColorFunction -> "ThermometerColors", 
 DataRange -> {{0, 1}, {0.9996, 1.0004}}, 
 FrameTicks -> {{0.9996, 0.9997, 0.9998, 0.9999, 1.0000, 1.0001, 
    1.0002, 1.0003, 1.0004}, None}, AspectRatio -> 7, 
 LabelStyle -> Large]

which gives me

enter image description here

we see the "1." looks out of place as it is.

Tom
  • 3,416
  • 1
  • 18
  • 33

1 Answers1

5

Use a function with NumberForm to construct your FrameTicks.

FrameTicks -> {{#, NumberForm[#, {5, 4}]} & /@ legend[[All, 1]], None}
Edmund
  • 42,267
  • 3
  • 51
  • 143