tsdev / spinw

SpinW Matlab library for spin wave calculation
www.psi.ch/spinw
GNU General Public License v3.0
30 stars 35 forks source link

Plotting of all SpinW coordinate systems #26

Open henrikjacobsenfys opened 7 years ago

henrikjacobsenfys commented 7 years ago

It would be neat to be able to plot the xyz coordinate systems and the a^, b^ and c^* coordinate systems when using the plot() command.

tsdev commented 7 years ago

It is in 921417b! I added the option to choose 'abc', 'xyz' and 'hkl' coordinate systems to show. Use: swplot.plotbase('mode','hkl'), etc. Let me know if this is what you wanted!

henrikjacobsenfys commented 7 years ago

This is very nice! Is it possible to make it so that more than one coordinate system can be plotted simultaneously?

tsdev commented 7 years ago

It is possible. You have to use the separate command that plots the coordinate system: swplot.plotbase('mode','xyz','replace',false) Setting the replace option to false will avoid deleting the previous coordinate system. You also have to shift the new coordinate system, check out the help for details: help swplot.plotbase

henrikjacobsenfys commented 7 years ago

Hi again It seems to me that there might be a bug in the plotting. Example:

test = spinw; test.genlattice('lat_const',[4.684 3.423 5.129],'angled',[90 110 90],'sym','C 2/c') plot(test,'range',[1 1 1 ]) swplot.plotbase('replace',false,'mode','hkl','shift',[-3;0;0])

In this case, L is quite different from c, but h is identical to a, which I think shouldn't be the case. (edited using the 'replace' false option)

tsdev commented 7 years ago

Simple example: plot(spinw('https://goo.gl/kQO0FJ')); swplot.plotbase('replace',false,'mode','xyz','shift',[-3;0;0])

tsdev commented 7 years ago

I fixed it, hopefully it is right now: def8482

henrikjacobsenfys commented 7 years ago

Seems to work, thanks!