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

fitspec: data points in final graph moves when graph is rescaled #159

Open
mducle opened this issue Nov 24, 2023 · 1 comment
Open

fitspec: data points in final graph moves when graph is rescaled #159

mducle opened this issue Nov 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mducle
Copy link
Member

mducle commented Nov 24, 2023

fitspec can be given a plot parameter to generate a plot. When used and first plotted it looks ok, but if you resize the figure, then the points (seems to be plotted with a function sw_circle (code here)) move relative position w.r.t. the underlying color dispersion.

@mducle mducle added the bug Something isn't working label Nov 24, 2023
@mducle
Copy link
Member Author

mducle commented Apr 25, 2024

I can't reproduce this bug anymore (tried on R2020a, R2021a and R2024a), using this script (from tutorial 35):

luvo = spinw;
luvo.genlattice('lat_const',[5.2821 5.6144 7.5283],...
    'spgr','x+1/2,-y+1/2,-z; -x,-y,z+1/2; -x,-y,-z','label','P n m a')

% Lu atom
luvo.addatom('r',[0.003 0.031 1/4],'label','Lu1 Lu3+','color',[0 171 36])
% V atom
luvo.addatom('r',[1/2 0 0],'label','V1 V3+','S',1,'color',[166 166 171])
% O(1) atom
luvo.addatom('r',[0.082 0.487 1/4],'label','O1 O2-','color',[255 13 13])
% O(2) atom
luvo.addatom('r',[0.223 0.216 0.534],'label','O2 O2-','color',[255 13 13])

luvo.gencoupling

% Parameters the describe the experimental data in the low T phase.
Jab   =  4.24;
Jc    =  5.95;
K     =  diag([0 -0.42 -0.48]);

luvo.addmatrix('value',Jab,'label','Jab','color','b')
luvo.addmatrix('value',Jc,'label','Jc','color','g')
luvo.addmatrix('value',K,'label','K','color','orange')

% The assigned the easy plane
luvo.addcoupling('mat','Jab','bond',2)
luvo.addcoupling('mat','Jc','bond',1)
luvo.addaniso('K')

luvo.genmagstr('mode','helical','S',[0 0 1]','n',[0 1 0],'k',[0 1 1]);

perf = swpref;
pref.tid = 0;

par_fit          = struct;
par_fit.datapath = 'LuVO3_fitted_modes.txt';

par_fit.Evect    = linspace(0,45,71);
par_fit.func     = @(obj,p)matparser(obj,'param',p,...
                    'mat',{'Jab' 'Jc' 'K(1,1)' 'K(2,2)'},'init',true);

par_fit.xmin      = [ 3   1  0   0    ];
par_fit.xmax      = [ 9  10  1   1    ];
par_fit.x0        = [ 6   4  0.1 0.04 ];
par_fit.plot      = true;
par_fit.hermit    = false;
par_fit.optimizer = 'simplex';
par_fit.maxiter   = 10;
par_fit.optmem    = 1;
par_fit.nrun      = 5;

fitStr = luvo.fitspec(par_fit);

@RichardWaiteSTFC - I don't quite remember the exact case to reproduce this - do you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant