how to draw the grayscale arrays using the ArrayPlot command of a square of the size of 40 by 40 pixel, with the values of 100.
ArrayPlot[Table[100, {x, 40}, {y, 40}], Mesh -> True,
PixelConstrained -> {40, 40}]
I am using the above code but I am not seeing a change in the gray scale for 0.1 or any other values except 0.
And I also want to change the values in each line from 1 to 40. So, I can see the change in grayscale.
ArrayPlot[ConstantArray[Subdivide[39], 40]]
? (For comparison, look atImage[ConstantArray[Subdivide[39], 40]]
.) $\endgroup$ – J. M.'s ennui♦ Feb 18 at 13:05ArrayPlot
uses the value you specified to color that cell.Table[100, {x, 40}, {y, 40}]
will generate a matrix which all of its value is100
, so you should not see any changes. $\endgroup$ – Beny Izd Feb 18 at 13:09ArrayPlot[Table[0.8, {x, 40}, {y, 40}], Mesh -> True, PixelConstrained -> {40, 40}, ColorFunctionScaling -> False, ColorFunction -> GrayLevel]
orArrayPlot[Table[0.8, {x, 40}, {y, 40}], Mesh -> True, PixelConstrained -> {40, 40}, ColorFunctionScaling -> False, ColorFunction -> (GrayLevel[1-#]&)]
$\endgroup$ – Michael E2 Feb 18 at 14:38