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

Is there a potential bug in the labeling function of the levelplot? #348

Open
cerium1925 opened this issue Aug 26, 2024 · 1 comment
Open

Comments

@cerium1925
Copy link

This issue arises because levelplot uses a fixed font size when setting the legend. When different level plots are combined into one figure and the figure is resized, the legend fonts for each subplot don't seem to adjust according to the adaptive size of the MATLAB figure window. The test results are shown in the following figure:
1
2
3
4

The likelihood of this issue occurring is low, and it can be mitigated by not setting a fixed font size, allowing MATLAB to handle it automatically. The test code is as follows:
clc, clear, clf;

% Experimental parameter----------
Exp.mwFreq = 9.8; % 9.8404
Exp.Range = [0 900];
Exp.nPoints = 1e4;

Exp.MolFrame = [0 0 0]*pi./180;
Exp.SampleFrame = [0 0 0]; % z

% Exp.CrystalSymmetry = 141;
Exp.Harmonic = 1;

Opt.Verbosity = 2;

% ion ..............
Sys.S = 1/2;
Sys.g = [8 4 2];
Sys.lw = [2 0];

subplot(2,2,1);
[b,spc,trans] = pepper(Sys,Exp,Opt);
spc = normalize(spc,'range',[0 1]);
plot(b,spc,'linewidth',1);
axis tight;
xlabel('Magnetic field (mT)');
ylabel('Intensity (a.u.)');

subplot(2,2,2);
Ori = 'x';
Opt.SlopeColor = true;
levelsplot(Sys,Ori,Exp.Range,Exp.mwFreq,Opt);
xlabel('magnetic field (mT)');
ylabel('energy (GHz)');

subplot(2,2,3);
Ori = 'y';
Opt.SlopeColor = true;
levelsplot(Sys,Ori,Exp.Range,Exp.mwFreq,Opt);
xlabel('magnetic field (mT)');
ylabel('energy (GHz)');

subplot(2,2,4);
Ori = 'z';
Opt.SlopeColor = true;
levelsplot(Sys,Ori,Exp.Range,Exp.mwFreq,Opt);
xlabel('magnetic field (mT)');
ylabel('energy (GHz)');

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

No branches or pull requests

2 participants
@cerium1925 and others