In [3]:
using PyPlot
using Interact



In [2]:
using Histeresis

In [50]:
L = 50
R = 4
N = L^2
H_max = 15

fig = figure(figsize=(7,5))
xlabel(L"H/J") #J=1
ylabel(L"M/N")


@manipulate for H_set=-H_max:H_max, espin=[symbol("-1") => -1, symbol("+1") => 1]
    withfig(fig) do
        xlim(-H_max,H_max)
        ylim(-1,1)
        
        m = edo_inicial(L,R,espin)
        mag, hs = magnetizacion_aumenta_H!(m,H_set,espin)
        plot(hs,mag/N, ".")
    end
end


Out[50]:

Leyenda


In [30]:
fig = figure(figsize=(5,3))
xlim(0,1)
ylim(0,1)

plot([0:1], [0:1], label="algo")
legend(loc="upper left")


Out[30]:
PyObject <matplotlib.legend.Legend object at 0x11a1429d0>

In [ ]: