1
$\begingroup$

I'm having a problem where the following animation jumps around despite having PlotRange set. I don't have this problem with ListPlot, any suggestions what other options to set?

(* Spectrum of interleaved normal and bernoulli matrices *)
d = 128;
randNormal := 
  RandomVariate[NormalDistribution[0, 1], {d, d}]/Sqrt[d];
randInteger := 
  N@Normal@AdjacencyMatrix@
      RandomGraph[BernoulliGraphDistribution[d, .5]]/Sqrt[d/2];
svals = {};
mat = IdentityMatrix[d];
maxIters = 10;
For[i = 1, i <= maxIters, i += 1,
  mat = mat.randNormal.randInteger;
  AppendTo[svals, SingularValueList[mat]]
  ];

makeplot[k_] := 
 ListLogLogPlot[svals[[k]], PlotRange -> {{0, d}, {10^-10, 0}}]
animation = ListAnimate[makeplot /@ Range@maxIters]

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

animation jumps around

I assume you are taking about the y-axis shaking?

I think this is because you used zero for the plot range and log(0) does not play well in the code.

If you change the zero, to another non zero value then it stops shaking. I also added image padding for safe measure.

makeplot[k_] := 
 ListLogLogPlot[svals[[k]], PlotRange -> {{0, d}, {10^-10, 100}}, 
  ImagePadding -> 30, ImageSize -> 400]

enter image description here

Compare to when using PlotRange -> {{0, d}, {10^-10, 0}}

enter image description here

It is possible this question is duplicate to Log-Plots and PlotRange

$\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.