0
$\begingroup$

Why is that my plot is returning an error? My sect[[]] returns a correct format for the range parameter of the plot. But still only getting one color in the full matrix graphic. Is there another way to set the parameters?

g[x_, y_] = 10 Cosh[(4 x/2 + .5)*Pi] Sinh[(4 y/2 + 1.1)*Pi]
sect = {{x, 0, 5 Pi}, {y, 0, 5 Pi}}
sect[[1]]
sect[[2]]
r = MatrixPlot[Table[g[x, y], sect[[1]], sect[[2]]], 
  ImageSize -> {700, 700}, AspectRatio -> Full]

The resulting image is picking up just one color and not a profile from 0 to 5 Pi.

Getting this error : But I see that Set returns the correct format.

$\endgroup$
0

1 Answer 1

2
$\begingroup$
g[x_, y_] := 10 Cosh[(4 x/2 + .5)*Pi] Sinh[(4 y/2 + 1.1)*Pi]
sect = {{x, 0, 5 Pi}, {y, 0, 5 Pi}};
ticks = Table[{i, i 5 Pi/16}, {i, 2, 16, 2}];
(*OR:  ticks = Transpose @ {Range[0,16,2],Subdivide[5 Pi,8]}; *)

r = MatrixPlot[Table[g[x, y], Evaluate@sect[[1]], Evaluate@sect[[2]]],
     FrameTicks -> {{ticks, ticks}, {ticks, ticks}}, 
     PlotLegends -> Automatic]

enter image description here


The picture is clearer with a log-scale:

r = MatrixPlot[
     Table[Log @ g[x, y], Evaluate@sect[[1]], Evaluate@sect[[2]]], 
      FrameTicks -> {{ticks, ticks}, {ticks, ticks}}, 
       PlotLegends -> Automatic]

enter image description here

(See also here).

$\endgroup$

Your Answer

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

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