Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overplotting Q vectors on 3D crystal structure #32

Open
henrikjacobsenfys opened this issue Mar 6, 2017 · 1 comment
Open

Overplotting Q vectors on 3D crystal structure #32

henrikjacobsenfys opened this issue Mar 6, 2017 · 1 comment
Labels

Comments

@henrikjacobsenfys
Copy link

henrikjacobsenfys commented Mar 6, 2017

Is there an easy way to plot one (or more) Q vectors along with the unit cell?

@tsdev tsdev added the question label Mar 7, 2017
@tsdev tsdev changed the title Plotting of Q vector Overplotting Q vectors on 3D crystal structure Mar 7, 2017
@tsdev
Copy link
Owner

tsdev commented Mar 7, 2017

You can plot arbitrary vectors using the swplot.plot() function onto a 3D crystal plot. For example (note the xyz coordinate system is used for the arrow plots):

myModel = sw_model('triAF',1);
plot(myModel,'range',[1 1 1/2])

% 100
Qrlu = [1 0 0];
QA   = Qrlu*myModel.rl;
swplot.plot('type','arrow','position',cat(3,zeros(3,1),QA'),'color','gold','unit','xyz');
swplot.plot('type','text','position',QA','text','[100]','unit','xyz')

% 010
Qrlu = [0 1 0];
QA   = Qrlu*myModel.rl;
swplot.plot('type','arrow','position',cat(3,zeros(3,1),QA'),'color','pink','unit','xyz');
swplot.plot('type','text','position',QA','text','[100]','unit','xyz')

The result should look like this:
spinw_rlu_vector_plot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants