Skip to content

Commit

Permalink
Fix bug with empty plot created when liveplot_interval=0
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardWaiteSTFC committed May 20, 2024
1 parent eefb777 commit 1fadf9c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions swfiles/sw_fitpowder.m
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,6 @@ function clear_cache(obj)
if obj.liveplot_interval > 0
figure("color","white");
obj.liveplot_counter = 0;
else
clf;
end
% setup cell for output of ndbase optimizer/minimizer
result = cell(1,nargout(obj.optimizer));
Expand Down Expand Up @@ -493,11 +491,6 @@ function plot_result(obj, params, varargin)
end

function plot_1d_cuts_on_data(obj, ycalc, varargin)
if obj.liveplot_interval == 0
figure("color","white");
else
clf;
end
modQs = mean(reshape(obj.modQ_cens, [], obj.ncuts), 1);
for icut = 1:obj.ncuts
ax = subplot(1, obj.ncuts, icut);
Expand All @@ -515,12 +508,6 @@ function plot_1d_cuts_on_data(obj, ycalc, varargin)
end

function plot_2d_contour_on_data(obj, ycalc, varargin)
% varargin passed to contour
if obj.liveplot_interval == 0
figure("color","white");
else
clf;
end
ax = subplot(1,1,1);
box on; hold on;
h = imagesc(ax, obj.modQ_cens, obj.ebin_cens, obj.y);
Expand Down Expand Up @@ -568,6 +555,11 @@ function plot_2d_contour_on_data(obj, ycalc, varargin)
end
end
function plot_1d_or_2d(obj, ycalc, varargin)
if obj.liveplot_interval == 0
figure("color","white");
else
clf;
end
if obj.ndim == 1
obj.plot_1d_cuts_on_data(ycalc, varargin{:})
else
Expand Down

0 comments on commit 1fadf9c

Please sign in to comment.