1
$\begingroup$

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!

$\endgroup$
1
$\begingroup$

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

| improve this answer | |
$\endgroup$
  • $\begingroup$ Interesting, I wonder why it affects the frame ticks? $\endgroup$ – Kane Jul 20 '14 at 13:29

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.