Skip to content

Commit

Permalink
Merge pull request #2141 from StolkArjen/colscf
Browse files Browse the repository at this point in the history
Fix: cfg.funcolorlim-dependent scaling of cloud radius
  • Loading branch information
robertoostenveld committed Nov 19, 2022
2 parents 45cdfa4 + 5d753d1 commit 0e1e432
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plotting/ft_plot_cloud.m
Expand Up @@ -317,8 +317,10 @@ function ft_plot_cloud(pos, val, varargin)
cmid = size(cmapsc,1)/2; % colorbar middle
colscf = 2*( (val-clim(1)) / (clim(2)-clim(1)) )-1; % color between -1 and 1, bottom vs. top colorbar
colscf(colscf>1)=1; colscf(colscf<-1)=-1; % clip values outside the [-1 1] range
radscf = val-(min(abs(val)) * sign(max(val))); % radius between 0 and 1, small vs. large pos/neg effect
radscf = abs( radscf / max(abs(radscf)) );

radscf = (val-min(abs(val)) * sign(max(val))); % 'vdown' representation
radscf = radscf / abs(clim(2)-clim(1)); % radius between 0 and 1, small vs. large pos/neg effect
radscf(radscf>1)=1; radscf(radscf<0)=0; % clip values outside the [0 1] range

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

0 comments on commit 0e1e432

Please sign in to comment.