Skip to content

Commit 0e1e432

Browse files
Merge pull request #2141 from StolkArjen/colscf
Fix: cfg.funcolorlim-dependent scaling of cloud radius
2 parents 45cdfa4 + 5d753d1 commit 0e1e432

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plotting/ft_plot_cloud.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,10 @@ function ft_plot_cloud(pos, val, varargin)
317317
cmid = size(cmapsc,1)/2; % colorbar middle
318318
colscf = 2*( (val-clim(1)) / (clim(2)-clim(1)) )-1; % color between -1 and 1, bottom vs. top colorbar
319319
colscf(colscf>1)=1; colscf(colscf<-1)=-1; % clip values outside the [-1 1] range
320-
radscf = val-(min(abs(val)) * sign(max(val))); % radius between 0 and 1, small vs. large pos/neg effect
321-
radscf = abs( radscf / max(abs(radscf)) );
320+
321+
radscf = (val-min(abs(val)) * sign(max(val))); % 'vdown' representation
322+
radscf = radscf / abs(clim(2)-clim(1)); % radius between 0 and 1, small vs. large pos/neg effect
323+
radscf(radscf>1)=1; radscf(radscf<0)=0; % clip values outside the [0 1] range
322324

323325
if strcmp(scalerad, 'yes')
324326
rmax = rmin+(radius-rmin)*radscf; % maximum radius of the clouds

0 commit comments

Comments
 (0)