I am trying to display the energy of a defect at various positions in a unit cell using a surface plot. I have data for 0.0 to 0.5 in each dimension so wish to display it as 'slices' through z with the colour displaying the energy value i.e. using surf(x,y,z,c) where c is the energy data.
For example, here are the energy values for z = 0
NaN NaN NaN 3.28 1.63 1.04
NaN NaN 10.26 3.02 1.95 1.63
NaN 10.26 3.81 3.50 3.02 3.28
3.28 3.02 3.50 3.81 10.26 NaN
1.63 1.95 3.02 10.26 1.63 NaN
1.04 1.63 3.28 NaN NaN NaN
The data is somewhat symetrical however when I plot the surface without using 'interp' it does not reflect this: here is the surface plot using 'interp'
Here is the plot without:
I would like to plot it without 'interp' as this would better represent my data (I do not know if it is a smooth transition in energy as indicated by the gradients)
As you can see for the first plot the full range of data is displayed - I dont understand why the plots are so different or how to solve this
Is it possible for the colour squares to be centred on the vertices? So that my full range of data is shown, i.e. (0.5,0.5,0) should be white due to NaN but in above plot is green.
I have tried simply extending the axis of my graph but that does not help, it just displays no data for the additional area.
My script is:
Thank you!!
figure
colormap hsv
mesh(X,Y,Z,K)
colorbar
caxis([-0.5 10.5])
xlabel('x'); ylabel('x'); zlabel('z')
xlim([0.0,0.5])
ylim([0.0,0.5])
zlim([0.0,0.5])
0 Comments
Sign in to comment.