Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Why do the frame ticks go away when PlotLegends->Automatic is inserted in an Array Plot? For instance, the following code produces an Array Plot with Frame Ticks.

ArrayPlot[Table[Random[], {i, 10}, {j, 10}], MaxPlotPoints -> 1000, 
ColorFunction -> "ThermometerColors", 
PlotLabel -> Style["Array Plot of Raw Data", 11, Bold, Black],
PlotRangePadding -> 0., ImageSize -> Full, 
AspectRatio -> 1/2, Frame -> True, 
FrameStyle -> Directive[Thick, Black], 
FrameLabel -> {Style["Y", 11, Bold, Black], 
Style["X", 11, Bold, Black]}, 
FrameTicks -> {{All, None}, {All, None}}, 
FrameTicksStyle -> Directive[Thick, Black, 11, Bold]]

Then when I add PlotLegends->Automatic, they go away!

ArrayPlot[Table[Random[], {i, 10}, {j, 10}], MaxPlotPoints -> 1000, 
ColorFunction -> "ThermometerColors", 
PlotLabel -> Style["Array Plot of Raw Data", 11, Bold, Black], 
PlotRangePadding -> 0., ImageSize -> Full, AspectRatio -> 1/2, 
Frame -> True, FrameStyle -> Directive[Thick, Black], 
FrameLabel -> {Style["Y", 11, Bold, Black], 
Style["X", 11, Bold, Black]}, 
FrameTicks -> {{All, None}, {All, None}}, 
FrameTicksStyle -> Directive[Thick, Black, 11, Bold], 
PlotLegends -> Automatic]

Here is the really strange thing about this. When I go to "drag" the array plot graphic as if I were going to move it somewhere or manipulate it, the Frame Ticks suddenly appear!

share|improve this question

1 Answer 1

The problem is with your ImageSize->Full option. Try leaving it out or specify your ImageSize to a certain size (e.g. 500) instead of Full.

otherOptions = {MaxPlotPoints -> 1000, 
   ColorFunction -> "ThermometerColors", 
   PlotLabel -> Style["Array Plot of Raw Data", 11, Bold, Black], 
   PlotRangePadding -> 0., ImageSize -> Full, AspectRatio -> 1/2, 
   Frame -> True, FrameStyle -> Directive[Thick, Black], 
   FrameLabel -> {Style["Y", 11, Bold, Black], 
     Style["X", 11, Bold, Black]}};

Column[Table[
  ArrayPlot[Table[Random[], {i, 10}, {j, 10}], 
   FrameTicks -> {{All, None}, {All, None}}, 
   FrameTicksStyle -> Directive[Thick, Black, 11, Bold], 
   PlotLegends -> Automatic, otherOptions[[i]]], {i, 1, 
   Length[otherOptions], 1}]]
(* the problem shows up in the 5th plot down, which is your ImageSize option *)

Mathematica graphics

share|improve this answer
    
Interesting, I wonder why it affects the frame ticks? –  Kane Jul 20 at 13:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.