1
$\begingroup$

I would like to create a labeled ArrayPlot with Mesh->True for example:

ArrayPlot[{{1, 0}, {0, 1}}, FrameLabel -> x, Mesh->True]

This does not show the FrameLabel, but

ArrayPlot[{{1, 0}, {0, 1}}, FrameLabel -> x]

does. I would guess it is a bug, but maybe there is some reason and I can work around it? I am on Mathematica 10.1.0.0 Linux.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

The issue is that ArrayPlot[{{1, 0}, {0, 1}}, FrameLabel -> x, Mesh->True] renders the plot without a frame (hence no framelabel):

ArrayPlot[{{1, 0}, {0, 1}}, FrameLabel -> x, Mesh->True]

Mathematica graphics

What is happening can be seen in a simpler example without FrameLabel:

ArrayPlot[{{1, 0}, {0, 1}}]

Mathematica graphics

Options[ArrayPlot[{{1, 0}, {0, 1}}], Frame]

{Frame -> Automatic}

Somehow adding the option Mesh->True sets the option Frame to False:

 ArrayPlot[{{1, 0}, {0, 1}}, Mesh -> True]

Mathematica graphics

Options[ArrayPlot[{{1, 0}, {0, 1}}, Mesh -> True], Frame]

{Frame -> False}

The fix is to add the option Frame->True:

ArrayPlot[{{1, 0}, {0, 1}}, Frame -> True, FrameLabel -> x, Mesh -> True]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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