Skip to content

Commit

Permalink
replace figure with gcf in distribspec in order to enable subplots
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoRianiUNIPR committed Oct 5, 2024
1 parent 8a9b563 commit 26a8579
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions toolbox/graphics/distribspec.m
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@


%{
% Exmple with the Chi2 distribution with v degrees of freedom.
% Example with the Chi2 distribution with v degrees of freedom.
% Set the degrees of freedom.
v=6;
% Create the Chi2 with v degrees of freedom
Expand Down Expand Up @@ -896,8 +896,12 @@
%% plot the distribution

% initialise figure
nspecfig = figure;
nspecaxes = axes;
% nspecfig = figure;
% nspecaxes = axes;
%
nspecfig = gcf;
nspecaxes=gca;

set(nspecaxes, 'Parent', nspecfig);
set(nspecaxes,'Nextplot','add');

Expand Down Expand Up @@ -1017,7 +1021,7 @@


% fill regions with user-defined or default color
if (ischar(userColor) && numel(userColor)==1) || (isnumeric(userColor) && size(userColor,1)==1)
if (ischar(userColor) && isscalar(userColor)) || (isnumeric(userColor) && size(userColor,1)==1)
xfill = [pll; x(k1); ll ; ul; x(k2); pul ];
yfill = [ypll; y(k1); flipud(yll) ; flipud(yul); y(k2); ypul ];

Expand Down

0 comments on commit 26a8579

Please sign in to comment.