Skip to content
Snippets Groups Projects
Commit 05203ad9 authored by Neukamm, Stefan's avatar Neukamm, Stefan
Browse files

update plot.py

parent 4c5bd7ae
No related branches found
No related tags found
No related merge requests found
...@@ -54,19 +54,33 @@ elif case==-1: # Read from outputs ...@@ -54,19 +54,33 @@ elif case==-1: # Read from outputs
# #
# #
N=200 length=.05
h=0.0005 N=300
h=length/N
E=np.zeros([N,N])
X=np.zeros([N,N]) X=np.zeros([N,N])
Y=np.zeros([N,N])
for i in range(0,N): for i in range(0,N):
for j in range(0,N): for j in range(0,N):
x=(i-N/2)*h x=(i-N/2)*h
y=(j-N/2)*h y=(j-N/2)*h
X[i,j]=(i-N/2)*h
Y[i,j]=(j-N/2)*h
K=xytokappaalpha(x,y) K=xytokappaalpha(x,y)
X[N-1-j,i]=energy(K[0],K[1],Q,B) # N-1-j damit die x,y Axen stimmen E[i,j]=energy(K[0],K[1],Q,B) # N-1-j damit die x,y Axen stimmen
fig = plt.figure(figsize=(6,6)) fig = plt.figure(figsize=(7,6))
plt.imshow(np.log(X-np.min(X)+0.0001)) # normalize to min = 0 and log scale to emphasize energy landscape ax = plt.gca()
ax.set_aspect(1)
ax.set_xticks([-length/4,0,length/4])
ax.set_yticks([])
#pcm = plt.pcolor(X,Y,E, norm=colors.LogNorm(vmin=E.min(), vmax=E.max()), cmap='winter', shading='auto')
pcm = plt.pcolor(X,Y,E, norm=colors.PowerNorm(gamma=0.2), cmap='winter', shading='auto')
plt.colorbar(pcm, extend='max')
#plt.imshow(np.log(E-np.min(E)+0.0001)) # normalize to min = 0 and log scale to emphasize energy landscape
# TODO: Beschriftung der Axen sollte von [-h*N/2, h*N/2] sein! # TODO: Beschriftung der Axen sollte von [-h*N/2, h*N/2] sein!
# Kreis mit Radius 1 einzeichnen # Kreis mit Radius 1 einzeichnen
plt.show() plt.show()
#
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment