0
$\begingroup$
size = 50;
Clear[s];
hot[seed_] := Module[{}, RandomSeed[seed];
  Table[If[RandomInteger[] ⩵ 0, 1, -1], {i, 1, size}, {j, 1, size}]]
cold[m_] := Table[Sign[m], {i, 1, size}, {j, 1, size}]
s = hot[123];
plotIsing := 
  ListDensityPlot[s, Mesh \[RightArrow] False, 
   InterpolationOrder \[RightArrow] 0, 
   PlotRange \[RightArrow] {-1, 1}];
plotIsing

Hello, this is my attempt to create a grph of 2-D ising Modle. However, I get an error message

ListDensityPlot::nonopt: Options expected (instead of PlotRange\[RightArrow]{-1,1}) beyond position 1 in ListDensityPlot[<<1>>]. An option must be a rule or a list of rules.

I replaced the "RightArrow" to "Rule", but my Mathematica automatically change "Rule" to "Rightarrow". What should I do to resolve this issue?

Thank you!

$\endgroup$
1
  • $\begingroup$ I don't know why \[Rule] would be replaced by \[RightArrow], but as an immediate workaround (and typically what I type) use - followed by >. When you enter a space afterward, the front end should replace it with \[Rule]. $\endgroup$ Commented Apr 19, 2021 at 20:26

1 Answer 1

1
$\begingroup$
ListDensityPlot[s, Mesh -> None, InterpolationOrder -> 0, PlotRange -> {-1, 1}]

enter image description here

$\endgroup$

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.