4

For some reason the ticks don't work on this:

ArrayPlot[Thread@{Range[0, 1, 0.01]}, AspectRatio -> 4, 
 ColorFunction -> "Rainbow",
 PlotRange -> {{0.`, 1.`}, {0.`, 1.`}},
 FrameTicks -> {{None, {{0, 75}, {1/5, 100}, {2/5, 125}, {3/5, 
      150}, {4/5, 175}, {1, 200}}}, {None, None}},
 Frame -> True,
 PlotRangePadding -> 0,
 BaseStyle -> 
  Directive[Opacity[1], FontFamily -> "Bitstream Charter", 10],
 ImageSize -> {Automatic, 100}]
Tom Wellington
  • 1,539
  • 1
  • 12
  • 19

1 Answers1

6

I think that your problem is related to the fact that your array is actually a vector. If you use Automatic in FrameTicks you get this:

ArrayPlot

But you can apply this workaround:

ArrayPlot[Thread@{Range[0, 1, 0.01]}, AspectRatio -> 4, 
 ColorFunction -> "Rainbow", PlotRange -> {{0.`, 1.`}, {0.`, 1.`}}, 
 FrameTicks -> {{None, {{.5, 75}, {.7, 100}, {.9, 125}, {1.1, 150}, {1.3, 175}, 
 {1.5, 200}}}, {None, None}}, Frame -> True, 
 PlotRangePadding -> 0, 
 BaseStyle -> 
  Directive[Opacity[1], FontFamily -> "Bitstream Charter", 10], 
 ImageSize -> {Automatic, 100}]

ArrayPlot

Update

To get your gradient you have to remove the PlotRange and then specify a new set of ticks.

ArrayPlot[Thread@{Range[0, 1, 0.01]}, AspectRatio -> 4, 
 ColorFunction -> "Rainbow", 
 FrameTicks -> {{None, {{1, 75}, {20, 100}, {40, 125}, {60, 150}, {80,
       175}, {100, 200}}}, {None, None}}, Frame -> True, 
 PlotRangePadding -> 0, 
 BaseStyle -> 
  Directive[Opacity[1], FontFamily -> "Bitstream Charter", 10], 
 ImageSize -> {Automatic, 100}]

ArrayPlot with gradient

VLC
  • 9,818
  • 1
  • 31
  • 60