Skip to content
Snippets Groups Projects
Commit 89b1216d authored by Olivier Sauter's avatar Olivier Sauter
Browse files

fix gdat_plot so does plot if called with just gdat structure gdat_plot(aa)

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@5597 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 3cd0ad1c
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ function [fighandle]=gdat_plot(gdat_data,varargin); ...@@ -2,7 +2,7 @@ function [fighandle]=gdat_plot(gdat_data,varargin);
% %
% choices from doplot in gdat_data.gdat_params.doplot: % choices from doplot in gdat_data.gdat_params.doplot:
% doplot = 0: no plot % doplot = 0: no plot
% = 1: new figure created % = 1: new figure created (default if not given)
% = -1: add to current figure (with hold all) % = -1: add to current figure (with hold all)
% > 1: create new figure with this number, adding clf % > 1: create new figure with this number, adding clf
% <-1: add to figure number abs(doplot) (with hold all) % <-1: add to figure number abs(doplot) (with hold all)
...@@ -27,25 +27,27 @@ else ...@@ -27,25 +27,27 @@ else
return return
end end
doplot=0; doplot=1;
if isfield(gdat_plot_params,'doplot') && ~isempty(gdat_plot_params.doplot) if isfield(gdat_plot_params,'doplot') && ~isempty(gdat_plot_params.doplot)
doplot = gdat_plot_params.doplot; doplot = gdat_plot_params.doplot;
elseif isfield(gdat_data.gdat_params,'doplot') || ~isempty(gdat_data.gdat_params.doplot) elseif isfield(gdat_data.gdat_params,'doplot') || ~isempty(gdat_data.gdat_params.doplot)
doplot = gdat_data.gdat_params.doplot; if gdat_data.gdat_params.doplot~=0 % assume one does not call gdat_plot not to plot
doplot = gdat_data.gdat_params.doplot;
end
end end
if doplot==0; return; end if doplot==0; return; end
if all(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty(gdat_data.t) if all(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty(gdat_data.t)
fighandle = get(0,'CurrentFigure'); fighandle = get(0,'CurrentFigure');
if gdat_data.gdat_params.doplot == 1 if doplot == 1
fighandle = figure; fighandle = figure;
elseif gdat_data.gdat_params.doplot > 1 elseif doplot > 1
fighandle = figure(gdat_data.gdat_params.doplot); fighandle = figure(doplot);
clf; clf;
elseif gdat_data.gdat_params.doplot == -1 elseif doplot == -1
hold all hold all
elseif gdat_data.gdat_params.doplot < -1 elseif doplot < -1
fighandle = figure(abs(gdat_data.gdat_params.doplot)); fighandle = figure(abs(doplot));
hold all hold all
end end
if strcmp(gdat_data.gdat_request,'eqdsk') if strcmp(gdat_data.gdat_request,'eqdsk')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment